The contract at a glance
Do not hard-code model IDs from a static list. Call GET /v1/models with the user's key for models filtered by subscription, plan, permission, capability, and ready routes.
Bearer key
A single Authorization header.
Quota-aware
Subscription rate and quota enforcement.
Bounded SSE
Incremental deltas ending with [DONE].
Authentication
Authorization: Bearer YOUR_API_KEYThe full API key appears only on create or rotate. Key lists return only a masked prefix afterward; no endpoint retrieves the secret.
Endpoints
/v1/chat/completionsCreate an OpenAI-compatible chat completion.
/v1/comboQuote, fan out, and synthesize one request across multiple models.
/v1/modelsList models available to the current API key.
/v1/models/:modelRetrieve one model available to the current API key.
/v1/embeddingsCreate vector embeddings for text input.
/v1/messagesCreate a message using the Anthropic-compatible contract.
/v1/completionsCreate a legacy text completion.
/v1/images/generationsGenerate images from a text prompt.
/v1/images/editsEdit an image from an image and prompt.
/v1/audio/speechGenerate speech audio from text.
/v1/audio/transcriptionsTranscribe audio into text.
/v1/audio/translationsTranslate audio into English text.
/v1/rerankRerank documents against a query.
/v1/moderationsClassify potentially unsafe input.
/v1beta/modelsList models through the Gemini-compatible contract.
/v1beta/models/*pathGenerate content through the Gemini-compatible contract.
/v1/responsesCreate a response with the OpenAI Responses contract.
/v1/responses/compactCompact a Responses conversation context.
Code explorer
Switch endpoint, streaming mode, and client; code always uses an environment variable.
POST /v1/chat/completionscurl https://api.xpncore.com/v1/chat/completions \
-H 'Authorization: Bearer $XPNCORE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'Try it live
The browser calls the gateway directly; the secret stays only in this tab's memory.
The response will appear here.Responses and errors
200
OpenAI-compatible JSON with choices, usage, and model.
200 SSE
Each data event carries choices[].delta.content; [DONE] confirms completion.
4xx / 5xx
A clear error envelope for auth, scope, quota, validation, or upstream failures.
{
"id": "chatcmpl_...",
"object": "chat.completion",
"model": "provider/model",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Hello" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 12, "completion_tokens": 4, "total_tokens": 16 }
}data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hel"}}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"lo"}}]}
data: [DONE]If the stream emits an error or disconnects after a delta, preserve the partial output and do not retry automatically: a new request can duplicate content.
Limits and operations
Ready to send a request?
Setup Wizard creates the key and configuration; Playground calls the gateway directly with client-side limits.