Create API Keys
Before calling LLMAPI, create the correct API key type in the console. There are two key types:
| Type | Bound to | Primary use |
|---|---|---|
| General API key | General group | Text APIs, model listing, usage queries, synchronous OpenAI image endpoints, Gemini native paths, and other regular gateway APIs. |
| Image API key | Image batch group | Async image tasks, task retrieval, cancellation, and task events. |
The bindings are mutually exclusive. A general API key cannot bind to an image batch group. An image API key cannot bind to a general group.
Create a General API Key
Use a general API key for text models, OpenAI-compatible APIs, Anthropic Messages, Gemini native compatibility paths, and synchronous OpenAI image endpoints.
Steps:
- Sign in to the console and open the API Key page.
- Click Create API Key.
- Enter a name, for example
production-textorclaude-code. - Set Binding type to General group.
- Select an available Resource group.
- Optionally configure a custom key, IP restrictions, quota, rate limits, and expiration.
- Submit the form, then copy and store the generated key.
The selected general group determines available platforms and models:
| Group platform | Common endpoints |
|---|---|
| OpenAI | /v1/responses, /v1/chat/completions, /v1/models, /v1/images/generations |
| Anthropic | /v1/messages, /v1/messages/count_tokens |
| Gemini | /v1beta/models... and Gemini native compatibility paths |
| Antigravity | /antigravity/v1/messages, /antigravity/v1beta/models... |
Use the key like this:
curl https://llmapi.site/v1/models \
-H 'Authorization: Bearer YOUR_API_KEY'Create an Image API Key
Use an image API key for async image generation. It must bind to an image batch group exposed by the administrator. The batch group controls available models, account selection, concurrency limits, and pricing.
Steps:
- Sign in to the console and open the API Key page.
- Click Create API Key.
- Enter a name, for example
production-imageorbatch-image-jobs. - Set Binding type to Image batch group.
- Select an available Image batch group.
- Optionally configure quota, rate limits, and expiration.
- Submit the form, then copy and store the generated key.
Image API keys are only for async image task endpoints:
| Endpoint | Description |
|---|---|
POST /v1/images/tasks | Submit an async image task. |
GET /v1/images/tasks/{task_id} | Retrieve task status and result. |
POST /v1/images/tasks/{task_id}/cancel | Cancel a queued task. |
GET /v1/images/tasks/events | Subscribe to task events for the current key. |
Example:
curl https://llmapi.site/v1/images/tasks \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-2.5-flash-image",
"prompt": "a clean studio product photo of a matte black water bottle",
"image_size": "1K",
"aspect_ratio": "1:1",
"n": 1
}'Which One to Use
| Requirement | Use |
|---|---|
| Claude Code, Codex CLI, Chat Completions, Responses | General API key |
| Model listing and usage queries | General API key |
| Synchronous OpenAI image generation or edits | General API key with an OpenAI group that supports images |
| Long-running or production async image generation | Image API key |
Async image generation with gemini-2.5-flash-image or gemini-3.1-flash-image | Image API key bound to a batch group that includes the model |
Common Issues
| Symptom | Cause and fix |
|---|---|
/v1/images/tasks returns an unsupported-feature or permission error | You are using a general API key. Create and use an image API key bound to an image batch group. |
| The image model is unavailable | The selected image batch group does not enable that model, or the model name is incorrect. Use official Gemini model names for Gemini image generation. |
| Text endpoints do not work | Image API keys are only for async image tasks. Use a general API key for text APIs. |
| No image batch groups appear in the dropdown | The administrator has not exposed an available image batch group, or your account does not have permission to use one. |