Base URL and authentication
Base URLs, user API Keys, and authentication methods.
Every public protocol uses a DINGJIAI user API Key
Clients only need a user API Key. Upstream provider keys are used by DINGJIAI during server-side forwarding and must never appear in client configuration, curl examples, or public documentation.
Choose the Base URL
Clients append paths differently. If a tool automatically adds /v1/chat/completions, /v1/responses, or /v1/messages, enter the Base URL it expects. For direct HTTP requests, use the public paths below.
| Protocol | Common Base URL | Public path |
|---|---|---|
| OpenAI Chat Completions | https://dingjiai.com/v1 | POST /v1/chat/completions; compatible with POST /chat/completions |
| OpenAI Responses | https://dingjiai.com/v1 | POST /v1/responses |
| OpenAI Chat model list | https://dingjiai.com/v1 | GET /v1/models; compatible with GET /models |
| Anthropic Messages | https://dingjiai.com | POST /v1/messages or POST /anthropic/v1/messages |
| Anthropic model list | https://dingjiai.com | GET /anthropic/v1/models |
| Gemini GenerateContent | https://dingjiai.com | POST /v1beta/models/{model}:generateContent |
| Gemini streamGenerateContent | https://dingjiai.com | POST /v1beta/models/{model}:streamGenerateContent |
| Gemini model list | https://dingjiai.com | GET /v1beta/models |
The public paths accept both trailing-slash and non-trailing-slash forms. Documentation examples use the non-trailing-slash form consistently.
Additional endpoints
| Endpoint | Common Base URL | Path | Notes |
|---|---|---|---|
| OpenAI Images Generations | https://dingjiai.com/v1 | POST /v1/images/generations | Charged by the number of images actually returned |
| Anthropic Count Tokens | https://dingjiai.com | POST /v1/messages/count_tokens or POST /anthropic/v1/messages/count_tokens | Messages sub-endpoint; does not create a billing settlement |
| Images Edits | Not a public API Base URL | POST /api/img/edits | Private signed-in web endpoint; /v1/images/edits is not public |
Authentication
OpenAI-compatible endpoints use Bearer authentication.
-H "Authorization: Bearer YOUR_USER_API_KEY"Anthropic endpoints use x-api-key.
-H "x-api-key: YOUR_USER_API_KEY"Gemini-native endpoints should use x-goog-api-key.
-H "x-goog-api-key: YOUR_USER_API_KEY"Authentication boundaries
Prop
Type
Last updated on