Back to home

API Setup Guide

Configure your customer key, select model groups and understand usage and errors.

Last updated: 2026-10-18

Connect

  1. Obtain a pass and copy the customer key from the user center. Do not use an administrator key or a Magpie internal key.
  2. Choose an OpenAI-compatible Chat Completions client. Set Base URL to the /v1 address shown in the user center.
  3. Choose a group from your available models. The home page lists operator-published group members. Group names and membership can change.

Routing uses the request's model. Splitting tasks and choosing groups for subtasks is your client's responsibility. Groups may have multiple upstreams. Unhealthy targets cool down briefly; generation is not retried automatically.

Supported API and limits

Chat JSON, SSE and tool-call fields are forwarded. Native Claude Messages and Codex Responses are not supported. OpenAI chat compatibility does not guarantee every client feature. Output limits must be integers from 1 to 8192. Send either max_tokens or max_completion_tokens; the default is 4096.

All routes share the account allowance. Daily tokens reset at 00:00 UTC (07:00 in Vietnam); hourly and request limits remain rolling. Requests spanning midnight count toward the UTC date they started. Pausing or rotating keys does not reset usage. Pausing does not extend expiry. Explicit pre-generation rejections use no tokens. Interrupted responses or missing usage are marked as estimates. See remaining days and today’s usage (UTC) in the user center.

Errors and support

Check the key and pass status for 401. A 429 indicates account or upstream limits. A 502, 503 or 504 indicates an upstream failure, capacity protection or timeout. Blind retries, particularly after interrupted streams, may consume usage again.

Submit timestamps and request IDs through support in the user center. Never include keys or sensitive full prompts.