API Access
Get started
- Create an API key in the customer portal.
- Inject it into a server environment as
AICREDITS_API_KEY. - Call
/v1/modelsto select a currently available model. - Follow the quickstart to send a request.
Authentication safety
The data API uses Authorization: Bearer $AICREDITS_API_KEY. An AICredits API Key is not an official key issued by any Provider. Never put a Direct API key in a browser, mobile app, Git repository, image, log, or error report.
Migration and compatibility
See migrating from the OpenAI SDK or migrating from Anthropic Messages. Protocol compatibility does not guarantee identical model behavior, so validate outputs and error handling after migration.
Timeouts, limits, and retries
Configure connection, first-byte, and whole-request timeouts. Apply backoff after 429 responses. Use an explicit idempotency policy when retrying POST requests.
For diagnosis, retain the HTTP status, safe error code, and X-Request-Id. Do not log prompts or responses.
Chinese model integration
DeepSeek, Kimi, MiniMax and Zhipu GLM connect through the platform API. Read protocols from the public catalog and confirm available IDs with /v1/models; SDK 0.3.0 exposes listPublicModels and listModels respectively. GLM does not support Responses; use Chat or Messages. See the Chinese model guide.