- Completed registration.
- Created an API key.
- Have available credit on your account (the new-user trial credit is enough).
Basics
Test with cURL
Python — official openai SDK
Node.js / TypeScript
Streaming output
Addstream: true to the request body to use an SSE stream:
Switch to the Claude / Gemini native protocols
If your code originally uses the Anthropic or Google SDK, there’s no need to rewrite it — just pointbase_url at OpenPAI:
Debugging tips
- Log the
x-openpai-request-idresponse header — it speeds up diagnosis when you open a support ticket. - Use
https://openp.ai/v1/modelsto list the models the current key can access. - Console → Logs shows each call’s model, token usage and billing details (prompt / response content is not recorded).
Next steps
Client integrations
Connect in Cherry Studio / LobeChat / Cursor / Dify.
Advanced features
Streaming, tool calls, vision, reasoning, structured output.