Skip to main content
The Model Inference API authenticates requests with an API key. Send the key in the Authorization header when listing models or creating a chat request. With the OpenAI Python SDK, set the api_key parameter instead.

Get an API key

Open API Keys in the console and click Create API Key, or use an existing enabled key. For instructions on creating, pausing, resuming, and deleting keys or configuring spending quotas and rate limits, see Manage API keys.

Configure authentication

The API base URL is https://api.scitix.ai/model-api. The compatible URL https://api.scitix.ai/model-api/v1 is also available. Examples in this guide use the base URL without /v1 and append the endpoint path.

HTTP requests

Use the following header format. Replace <YOUR_API_KEY> with your key and keep the space after Bearer.
Set an environment variable in your local terminal to use the examples below. Replace YOUR_API_KEY with your actual key:
This command applies only to the current terminal session. Run it again when you open a new terminal, or add it to your shell’s user startup configuration to load it automatically.
Do not expose real keys in repositories, public documentation, screenshots, logs, browser frontends, or other client-side code. An environment variable does not replace secret protection. Remove keys before sharing terminal output or logs.

Python SDK

Set api_key when using the OpenAI Python SDK. Do not add the Bearer prefix to this value:
Use the API base URL for base_url, without /chat/completions. The SDK appends the endpoint path. If you receive KeyError: 'API_KEY', set the environment variable in the terminal that runs the script. For SDK installation and a complete request example, see Make your first API call.

Verify authentication

List models to check your key and header configuration. This request does not require a model ID or request body:
The --include option displays the HTTP status and response headers. Check the status first, then the body:
  • HTTP 200 with object: "list" and a model array in data means this model-list request succeeded.
  • HTTP 401 means you need to check the key and authentication header.
  • For other status codes, follow the actual error response. Do not treat every error as an authentication failure.
A successful model-list request does not mean every model supports chat requests, or that later calls will be exempt from spending quotas or rate limits. Check the model’s supported protocol and preserve the exact capitalization and vendor prefix in its ID.

Troubleshoot authentication failures

HTTP 401 indicates an authentication failure. The common error type is authentication_error, with code unauthorized. Use the actual error message to identify what to check: Messages help with diagnosis but should not be your application’s only error signal. Also check the HTTP status, error.type, and error.code.
  1. Confirm that the request sends Authorization: Bearer <YOUR_API_KEY>.
  2. Check that the environment variable is set in the terminal or application process making the request. Ensure it is not still a placeholder and contains no extra spaces or newlines. Do not print the full key to debug it.
  3. Check in the console that the key is enabled and has not been deleted. Resume a paused key; replace a deleted key.
  4. Correct the configuration, then send the model-list request again. Do not repeatedly retry with unchanged invalid credentials.
HTTP 402 indicates a billing requirement is not met. For 429, use the error type to distinguish a rate limit from a capacity issue. Neither should be handled as an invalid key. If authentication still fails, contact technical support with the request_id, request time and time zone, endpoint path, HTTP status, and error body. See Error handling. Remove API keys and other sensitive information first.