Authorization header. The gateway is OpenAI-compatible, so the OpenAI SDKs send this header for you once you set your key.
Get your API key
Create and manage keys in the dashboard. Your key looks likesk- followed by a long string.
1
Open the dashboard
Go to API keys in your Infyrence dashboard.
2
Create a key
Create a new key and give it a name so you can identify it later.
3
Copy the key
Copy the full
sk-... value and store it somewhere safe.Send the key
Set theAuthorization header to Bearer followed by your key.
api_key (Python) or apiKey (JavaScript). No other code change is needed.
Every model and inference endpoint under
https://api.infyrence.com/v1 requires this header, including GET /v1/models. The public status endpoint GET /v1/health/providers is the only exception.Keep your key secret
An API key grants access to your account balance and usage. Treat it like a password.Use your key only from server-side code. Do not embed it in browsers, mobile apps, or any client that ships to end users, and do not commit it to source control. Load it from an environment variable or a secrets manager instead.
401.
Authentication errors
If theAuthorization header is missing, malformed, or presents a key that is unknown, revoked, or expired, the gateway responds with 401 and an error body of type authentication_error.
string
A human-readable description of the problem.
string
The category of error. For authentication failures this is
authentication_error.string | null
A stable, machine-readable code when available, for example
invalid_api_key.string
The id of the failed request. It also appears in the
X-Request-Id response header. Include it when contacting support.401:
Missing or malformed header
Missing or malformed header
The
Authorization header is absent or does not start with Bearer . Send Authorization: Bearer sk-....Invalid key
Invalid key
The key does not match any key on your account. Confirm you copied the full
sk-... value with no extra whitespace.Revoked key
Revoked key
The key was revoked in the dashboard. Create a new key and update your app.
Expired key
Expired key
The key passed its expiration date. Create a new key.
Next steps
List models
Call
GET /v1/models for the live list of available models.Create a chat completion
Send your first authenticated request.