ApiLux

Test the connection (cURL / PowerShell)

Confirm your key, base URL and balance work — before touching any SDK or IDE.

Step 1 — Create an API key

  1. 01Open API Keys in the dashboard and create a new key.
  2. 02Copy it NOW — it is shown exactly once; ApiLux stores only a hash.
  3. 03Put it in an environment variable, not in source code.
Windows PowerShell
$env:APILUX_API_KEY = "apl_YOUR_API_KEY"
macOS / Linux
export APILUX_API_KEY="apl_YOUR_API_KEY"

Step 2 — Pick a model

List the models you can actually call. This endpoint is read-only and is NOT billed.

bash
curl https://apilux.net/api/v1/models \
  -H "Authorization: Bearer apl_YOUR_API_KEY"
Only use an id returned here. The catalogue changes over time, so do not hardcode an ID from documentation.

Step 3 — Make a call

bash
curl https://apilux.net/api/v1/chat/completions \
  -H "Authorization: Bearer apl_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [{ "role": "user", "content": "Xin chao" }]
  }'
Do NOT add stream: true. ApiLux does not support streaming yet and rejects it explicitly with 400 — deliberately, because silently returning non-streaming would hang an SSE client.

Configuration summary

ItemValue
Base URLhttps://apilux.net/api/v1
Key variableAPILUX_API_KEY
Base URL variableAPILUX_BASE_URL
Wire protocolchat.completions (streaming supported)

Troubleshooting

ErrorCause and fix
401Wrong or revoked key. Create a new one on the API Keys page.
402Insufficient balance. Top up and retry.
404Wrong base URL, or you are calling an endpoint ApiLux does not have yet (for example /messages, /responses).
400 unknown_modelThe model is not in your GET /models list. Pick an id from there.
400 streamingYou sent stream: true. Remove that field.
429Rate limit exceeded. Read the Retry-After header and wait that many seconds.
503The model is temporarily unavailable, or the system is in maintenance. You are not charged.
TimeoutSeconds are enough for chat; use 180-360s for images; video returns a job immediately, then poll.