WOX AI

Quickstart

Create a WOX API Key and make your first model request

Quickstart

Create a WOX API Key and make your first request through a compatible API

1. Create an API Key

After signing in to WOX, create a key on the API Keys page. The full key is normally shown only when it is created or when you explicitly reveal it, so store it securely.

We recommend using an environment variable for the key:

export WOX_API_KEY="YOUR_API_KEY"

2. Select a Model

Open the Models and Pricing page and copy the ID of an available model. YOUR_MODEL_ID is only a placeholder and does not identify a real model.

3. Send a Request

curl https://api.wox.lol/v1/chat/completions \
  -H "Authorization: Bearer $WOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [
      {
        "role": "user",
        "content": "Introduce yourself in one sentence."
      }
    ]
  }'

A successful request returns a JSON response. Availability of streaming responses, tool calls, images, audio, and other capabilities depends on the selected model and endpoint.

4. Common Checks

If the request fails, verify the following:

  • The Base URL points to an available WOX route and includes the correct /v1 path
  • The Authorization header contains Bearer followed by the actual API Key
  • The model ID comes from the current model list
  • The API Key has not expired, and its model, group, IP, and quota restrictions allow the request
  • The account has an available wallet balance or subscription quota

If the API returns 429, limit the number of retries. When the response includes Retry-After, wait for the specified interval; otherwise, use exponential backoff.

5. Next Steps