Enterprise API quickstart
Connect a project to the OpenAI-compatible chat API, send a streaming request, and reconcile usage by request ID.
Enterprise access is by invitation. Use the HTTPS URL, project key and usage limits provided when your pilot is approved.
1. Check your project’s models
Set AIX_API_ORIGIN to your approved HTTPS base URL without a trailing slash and AIX_PROJECT_KEY to your project key. Select an ID returned by the model list and set AIX_MODEL to that exact ID. Keep the project key in a server-side secret store.
curl -fsS --max-time 15 \
-H "Authorization: Bearer ${AIX_PROJECT_KEY:?}" \
"${AIX_API_ORIGIN:?}/v1/models"2. Send a chat request
Use a short test message containing no customer data. The example caps output at 32 tokens. Save the X-Platform-Request-Id response header for reconciliation.
curl -sS --fail-with-body --max-time 35 -D aix-sync.headers \
-H "Authorization: Bearer ${AIX_PROJECT_KEY:?}" \
-H 'Content-Type: application/json' \
"${AIX_API_ORIGIN:?}/v1/chat/completions" \
--data "$(printf '{"model":"%s","messages":[{"role":"user","content":"Reply OK."}],"max_tokens":32}' "${AIX_MODEL:?}")"3. Stream a response
The streaming request asks for usage. Check the final usage frame and the [DONE] marker. Save the response headers separately from the first request.
curl -NsS --fail-with-body --max-time 60 -D aix-stream.headers \
-H "Authorization: Bearer ${AIX_PROJECT_KEY:?}" \
-H 'Content-Type: application/json' \
"${AIX_API_ORIGIN:?}/v1/chat/completions" \
--data "$(printf '{"model":"%s","messages":[{"role":"user","content":"Reply OK."}],"max_tokens":32,"stream":true,"stream_options":{"include_usage":true}}' "${AIX_MODEL:?}")"4. Verify usage and charges
Sign in to the approved project’s usage page. Find the matching request ID, model and input and output tokens in the project view or CSV. A pending entry can show usage before reconciliation confirms an amount.
If a request fails
401 means the credential was rejected. Check the project balance on 402, and the usage limit or trial window on 429. A 503 with gateway_unavailable means the public gateway is closed. If a request times out or the stream ends before [DONE], ask pilot support to check the original request before sending it again.
