Docs
Start here. Full SDK reference, streaming, tool-calling, and SSO integration follow.
Create an account, generate a key, and make your first request in under 90 seconds.
Point your existing OpenAI SDK at OneAPIKey's base URL. Everything just works.
Use `provider/model` (e.g. `anthropic/claude-opus-4-7`) or the slug shown on the API page.
Standard HTTP status codes + a stable `error.code` enum: `insufficient_funds`, `rate_limited`, `upstream_error`, `invalid_key`, `validation_failed`.
Every request returns an `x-apimarket-request-id` and `x-apimarket-cost-usd` header so you can reconcile usage client-side.
Hand your users off to OneAPIKey for sign-up + key provisioning in two clicks. See the SSO guide.
OpenAI-compatible endpoint
Base URL:https://oneapikey.app/v1
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ONEAPIKEY_API_KEY"],
base_url="https://oneapikey.app/v1",
)
res = client.chat.completions.create(
model="openai/gpt-5",
messages=[{"role": "user", "content": "ship it"}],
)Errors
All errors return JSON: { "error": { "code": "…", "message": "…" } }
Response headers
x-apimarket-request-id— trace a call in your dashboard.x-apimarket-cost-usd— exact cost charged to your account.x-apimarket-upstream-ms— upstream latency in milliseconds.
SSO (2-click connect)
- Register an SSO client in the admin console.
- Redirect your users to
/sso/authorize?client_id=…&redirect_uri=…&state=… - User approves, we issue a code. Exchange it server-side for an access token + provisioned key.