Developer guides · API access # OpenAI-compatible API quickstart: base URL, key and model Connect applications to Xinghuo AI Gateway with a site API key, discover permitted model IDs and send a small Chat Completions request using cURL. Xinghuo AI Gateway · Updated 2026-10-09 For an application or script supporting an OpenAI-compatible API, configure three values: a site-issued API key, the base URL and an authorized model ID. ## Configure the URL and key Sign in, create a key and check its group and credits. The SDK base URL is `https://ai.wfpromax.xyz/v1`. The full Chat Completions endpoint is `https://ai.wfpromax.xyz/v1/chat/completions`. Avoid appending `/v1` twice. ## Discover the models permitted for your key The public catalog describes available groups, but actual key permissions can differ. Query the models endpoint and copy an exact returned ID. ``` export XINGHUO_API_KEY='replace-with-site-api-key' curl --fail-with-body --max-time 30 \ https://ai.wfpromax.xyz/v1/models \ -H "Authorization: Bearer $XINGHUO_API_KEY" ``` ## Send a small request Replace the model placeholder with an authorized ID. Generation can consume paid credits. Limit output, then inspect the usage record. ``` curl --fail-with-body --max-time 60 \ https://ai.wfpromax.xyz/v1/chat/completions \ -H "Authorization: Bearer $XINGHUO_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"replace-with-available-model-id","messages":[{"role":"user","content":"Reply hello only"}],"max_tokens":32,"stream":false}' ``` ## Confirm success Check the expected JSON answer and the corresponding site usage record, not just the HTTP status. Test streaming, tools and context limits separately for your workload; compatibility does not guarantee every parameter. ## Choose the right endpoint A Responses client uses `/v1/responses` with a supported model. Claude Code requires Messages configuration; see the [Claude Code guide](https://ai.wfpromax.xyz/guides/en/claude-code.html). Do not put a Chat Completions endpoint into a Messages base URL field. ## Protect keys and bound retries Keep real keys in server environment variables or trusted secure configurations, never in public browser code or repositories. Start with low concurrency. For failures, follow the [error guide](https://ai.wfpromax.xyz/guides/en/api-errors.html) instead of retrying indefinitely. ## Choose a model. Connect your application. Check current model access and account pricing, then register and buy the credits you need. [View models & pricing](https://ai.wfpromax.xyz/available-channels?entry=guide_en_openai-compatible-api) [Buy credits](https://ai.wfpromax.xyz/purchase?entry=guide_en_openai-compatible-api) [Create an account →](https://ai.wfpromax.xyz/register?entry=guide_en_openai-compatible-api) ## Related guides [What is Xinghuo AI Gateway? API access, models and service scope](https://ai.wfpromax.xyz/guides/en/service.html)[Claude Code gateway setup: base URL, authentication and model](https://ai.wfpromax.xyz/guides/en/claude-code.html)[AI API token billing explained: input, output and cache](https://ai.wfpromax.xyz/guides/en/token-billing.html)[AI API error guide: 401, 403, 404, 429 and 503](https://ai.wfpromax.xyz/guides/en/api-errors.html)[AI API buying guide: models, pricing, credits and redemption](https://ai.wfpromax.xyz/guides/en/buying-guide.html)[How to choose GPT, Claude, Gemini or Kimi API models](https://ai.wfpromax.xyz/guides/en/model-selection.html)[ChatGPT and Claude subscriptions vs API credits: what is different?](https://ai.wfpromax.xyz/guides/en/api-vs-subscription.html)