Enterprise onboarding
Once your enterprise account is provisioned under contract, ask an administrator for a project API key. Send a first request to an authorized model with cURL, Python or Node.js, then check token usage in enterprise logs.
Quickstart
Token Pyxis provisions service only for enterprises with a signed agreement. The public website offers no sign-up flow. Confirm your gateway URL and access with your enterprise administrator. See how access is provisioned
Create an enterprise API key
An authorized enterprise administrator issues the key under API Keys in the console. The secret is shown once. Store it in your server-side secret manager.
Manage keysChoose a model ID
Choose a chat-capable model. Confirm access in your enterprise catalog or call /v1/models with your API key.
Browse the model catalogSend your first request
On your server, set BASE_URL to the gateway origin (omit /v1) and store the key in TOKEN_PYXIS_API_KEY.
Replace MODEL_ID with the ID of your chosen model.
Example environment variables
export BASE_URL="https://tokenpyxis.com"
export TOKEN_PYXIS_API_KEY="sk-your-key"Use your enterprise deployment URL if it differs. Inject real keys through your deployment’s secret manager.
POST /v1/chat/completionsBASE_URL="${BASE_URL:-https://tokenpyxis.com}"
curl -i "${BASE_URL%/}/v1/chat/completions" \
-H "Authorization: Bearer $TOKEN_PYXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"messages": [
{
"role": "user",
"content": "Hello! What can you help with?"
}
]
}'After confirming the model output, save the response header x-request-id and look up the model and token usage in the console logs. Reconciliation steps
Base URL and authentication
Set BASE_URL to your enterprise gateway origin. Append the full endpoint for raw HTTP requests. Use the SDK base below to avoid duplicating /v1.
| Access | Base and path | Credential |
|---|---|---|
| OpenAI | SDK base https://tokenpyxis.com/v1POST /v1/chat/completions | Authorization: Bearer sk-… |
| Anthropic | SDK base https://tokenpyxis.comPOST /v1/messages | x-api-key: sk-… |
| Gemini | Native HTTP endpointPOST /v1beta/models/{model}:generateContent | x-goog-api-key: sk-… |
| Enterprise management | https://tokenpyxis.com/api/enterprise/… | Sign-in JWTAuthorization: Bearer <jwt> |
| Public catalog | GET /api/public/models | Public evaluation data, no authentication required |
A token is a unit of model input or output usage. Use an API key for inference and a sign-in JWT for enterprise management.
Endpoint index
Check the model catalog for model capabilities. Access also depends on enterprise permissions and channel availability.
Rate limits and quotas
Platform, pricing group, enterprise, subscription, API key and channel limits can apply to the same request. RPM means requests per minute and TPM means tokens per minute. On 429, honor Retry-After when present, then use exponential backoff with jitter.
Set up budgets, plans and rate limits
Model discovery
/v1/modelsList the models available to your inference key using the OpenAI response format. GET /v1/models/{id} looks up one allowed model or alias.
curl "https://tokenpyxis.com/v1/models" -H "Authorization: Bearer $TOKEN_PYXIS_API_KEY"/api/public/modelsThe public catalog lists published models linked to enabled channels with active credentials. Compare capabilities, aliases, list rates and group discounts. Check model access separately with your enterprise API key.
/api/public/{groups,providers,status}Read group discounts, aggregate provider information or the gateway version and request-log retention settings.
OpenAI compatible endpoints
/v1/chat/completionsSend messages for text completion. Tool calls, vision and other features depend on the selected model and route.
Inspect the response body for output and token usage. Save x-request-id for reconciliation.
/v1/chat/completionsSet stream: true to consume server-sent events. Clients can request usage through stream_options.include_usage.
Read SSE events until data: [DONE]. Use the streaming example to handle chunks. A stream can end before completion, so check the request status before resending.
/v1/chat/completionsSet web_search: true to request the gateway search extension. A search provider must be enabled by the operator.
/v1/embeddingsCreate embeddings for a text input or a batch.
/v1/responsesSend input using the OpenAI Responses protocol. Set stream: true where supported.
Set the environment variables from the quickstart and replace MODEL_ID with an allowed model that supports this protocol.
curl -i "https://tokenpyxis.com/v1/responses" \
-H "Authorization: Bearer $TOKEN_PYXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"input": "Introduce yourself in one sentence."
}'/v1/responses/compactCompact context with a model that supports the native Responses compaction protocol. This endpoint returns JSON.
/v1/images/editsEdit an image from a prompt and reference image. Provide a JSON body or multipart form data with an optional mask.
/v1/images/generationsGenerate images. n determines the number of images and the fixed fee is applied per image where configured.
/v1/audio/speechSynthesize audio from text with a model and voice supported by the route.
/v1/audio/transcriptionsUpload audio using multipart/form-data with a model and file.
/v1/rerankRerank a list of documents against a query.
/v1/videos/generationsSubmit an asynchronous video generation job and retain the returned job ID.
/v1/videos/{id}Poll a video job or request cancellation. A key can only access jobs within its authorized scope.
/v1/realtimeOpen a bidirectional WebSocket session for a supported realtime model.
wss://tokenpyxis.com/v1/realtime?model=MODEL_IDNative media endpoints
/v1/media/operations/{operation}Submit the enterprise model ID and the operation parameters. Model details list the available operations and their billing units. A submission_pending result means the original job is awaiting confirmation. Retain its ID.
/v1/media/tasks/{id}Read task status and artifacts within the current enterprise and department. POST /v1/media/tasks/{id}/cancel requests cancellation.
/v1/audio/realtime?model=MODEL_IDStream 16 kHz mono PCM audio in a duplex recognition session. Charges use cumulative billed seconds.
Gemini compatible endpoints
/v1beta/models/{model}:generateContentUse Gemini request and response formats. Native routes preserve tools, safety settings, media and cached content. Cross-protocol routes accept compatible text requests.
Set the environment variables from the quickstart and replace MODEL_ID with an allowed model that supports this protocol.
curl -i "https://tokenpyxis.com/v1beta/models/MODEL_ID:generateContent" \
-H "x-goog-api-key: $TOKEN_PYXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Introduce yourself in one sentence."
}
]
}
]
}'/v1beta/models/{model}:streamGenerateContent?alt=sseReceive an SSE response in Gemini format. The gateway forwards incremental output and provider usage metadata when available.
/v1beta/modelsList models and supported generation methods in Gemini format.
Anthropic compatible endpoints
/v1/messagesUse the Anthropic Messages protocol with system, messages, max_tokens and supported thinking or cache settings. Cache writes can have separate five-minute and one-hour prices.
Set the environment variables from the quickstart and replace MODEL_ID with an allowed model that supports this protocol.
curl -i "https://tokenpyxis.com/v1/messages" \
-H "x-api-key: $TOKEN_PYXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"max_tokens": 64,
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence."
}
]
}'Enterprise operations
/api/auth/loginSign in with a provisioned enterprise or authorized member account to obtain an access JWT. Send Authorization: Bearer <jwt> with management requests. Roles govern write and financial access.
/api/enterprise/{wallet,models,logs,logs/stats}Review balance, effective model prices and request logs. Log filters include page, size, key, model, status, from, to and request_id.
/api/enterprise/{usage,usage/export,insights}Review daily usage, download CSV or see spend and cache insights. Usage accepts days or from_day and to_day, with optional grouping.
/api/enterprise/{tasks,captures,audit,redeem}Review jobs, request captures or audit entries within your permissions. Authorized enterprise administrators can POST to redeem with a code issued under their agreement.
Errors
| HTTP | Code | Action |
|---|---|---|
| 400 | invalid_request | Review the error message and correct the request or model selection. |
| 401 | invalid_api_key and related errors | Check which credential the endpoint requires and whether the credential is active and unexpired. |
| 402 | insufficient_balance | Ask your enterprise administrator to check wallet balance, allowances and settlement terms. |
| 403 | permission_denied / ip_banned | Review access or moderation rules and contact your administrator if needed. |
| 404 | not_found | Confirm the model or route is available. |
| 408 | request_timeout | The client request timed out. |
| 409 | already_exists / seats_exceeded | Check for a conflicting resource or a seat limit. |
| 413 | request_too_large | Reduce the request body size. |
| 429 | rate_limited | Use Retry-After when present and apply exponential backoff with jitter. |
| 500 | internal_error | Save the request ID and check the logs or job status before retrying. |
| 502 / 504 | upstream_error | An upstream provider failed or timed out. Check partially streamed responses and submitted jobs before resending. |
| 503 | overloaded / no_available_channel / unavailable | Retry after a delay or contact the service administrator. |
Billing
Input, output and cache rates are listed in CNY per million tokens. Token charges apply the model multiplier and the effective enterprise discount. Fixed fees are added separately per endpoint unit, such as an image, a video second or a request.
Internal amounts are stored in micros (1 CNY = 1,000,000 micros). Subscription allowances cover eligible usage first. Billable overage is charged to the wallet. Pricing snapshots allow reconciliation by request ID. Your signed enterprise agreement governs fees and settlement.
For example, at rates of 1 CNY per million ordinary input and output tokens, and 0.50 CNY per million cache-read tokens, 960 ordinary input, 40 cache-read and 200 output tokens cost 1,180 micros before discounts. With a model multiplier of 1 and a 30% discount, the token charge is 826 micros (0.000826 CNY).
Compliance and AI labels
The gateway can send X-AIGC-Label: AIGC-generated by default. Use it as a signal and implement any notices and file metadata required for end-user display, downloads or sharing. See the compliance notice and data security guide for details.
