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 ishttps://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.
YOUR_API_KEY with your actual key:
Python SDK
Setapi_key when using the OpenAI Python SDK. Do not add the Bearer prefix to this value:
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:--include option displays the HTTP status and response headers. Check the status first, then the body:
- HTTP
200withobject: "list"and a model array indatameans this model-list request succeeded. - HTTP
401means 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.
Troubleshoot authentication failures
HTTP401 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.
- Confirm that the request sends
Authorization: Bearer <YOUR_API_KEY>. - 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.
- Check in the console that the key is enabled and has not been deleted. Resume a paused key; replace a deleted key.
- Correct the configuration, then send the model-list request again. Do not repeatedly retry with unchanged invalid credentials.
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.
- For spending quotas and rate settings, see Manage API keys.
- For throttling guidance, see Rate limits.
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.
