Skip to content

Controlled development preview · Public production access is not enabled. No online checkout is available.

Developer quickstart

  1. Create an account and sign in. In Portal → API Keys, create a key and securely save it once. Keep it on your server, never in a browser or support message.
  2. Confirm access with the operator through Portal → Support. Funding is closed; registration alone does not grant funded API access.
  3. Install the Python SDK with pip install openai. Set AI_GATEWAY_API_KEY and AI_GATEWAY_BASE_URL in your local process. Replace the base URL with the confirmed HTTPS endpoint ending in /v1; do not run against an invented domain.
  4. Send a small non-streaming text request, then check Portal → Usage for tokens and actual charge, and Portal → Billing for account entries. Temporary holds appear separately from spend.

Compatibility is limited to POST /v1/chat/completions and authenticated GET /v1/models. The request fields are model, messages, max_tokens and stream=false. Messages contain role and string content only. Extra fields are rejected. This is not full OpenAI API compatibility.

Start with a small text request

Use a funded account and a server-side API key. Install the Python openai package. The operator must confirm the HTTPS API base URL before use; this preview has no announced production endpoint.

quickstart.py
import os
from openai import OpenAI

# Set AI_GATEWAY_BASE_URL to the operator-confirmed HTTPS API URL ending in /v1.
# No public production API domain has been announced yet.
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url=os.environ["AI_GATEWAY_BASE_URL"],
    max_retries=0,
)
response = client.chat.completions.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "Hello, world!"}],
    max_tokens=32,
    stream=False,
)
print(response.choices[0].message.content)
print(response.usage)

Errors and safe recovery

  • 401: Missing, invalid or revoked API key. Check the key without exposing it.
  • 403: Key or customer is inactive, unavailable or not bound to an eligible account.
  • 402: Available balance is insufficient for the request estimate. Check balance and outstanding holds; funding is currently closed.
  • 422: Unsupported model, field, message shape, streaming or max_tokens. Correct the request before submitting again.
  • 429: Request admission/rate limit reached. Reduce concurrency and inspect the response; do not blindly repeat an uncertain request.
  • 5xx or a lost response: execution or settlement may be uncertain. Inspect Usage/Billing and contact support using a request ID if available.

Keep max_retries=0. No end-to-end request idempotency guarantee is provided. A timeout or failed response can leave a hold or correspond to completed work. Repeating the request may execute and bill again; reconcile the original result first.