Skip to content

Create API Keys

Before calling LLMAPI, create the correct API key type in the console. There are two key types:

TypeBound toPrimary use
General API keyGeneral groupText APIs, model listing, usage queries, synchronous OpenAI image endpoints, Gemini native paths, and other regular gateway APIs.
Image API keyImage batch groupAsync 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:

  1. Sign in to the console and open the API Key page.
  2. Click Create API Key.
  3. Enter a name, for example production-text or claude-code.
  4. Set Binding type to General group.
  5. Select an available Resource group.
  6. Optionally configure a custom key, IP restrictions, quota, rate limits, and expiration.
  7. Submit the form, then copy and store the generated key.

The selected general group determines available platforms and models:

Group platformCommon 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:

bash
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:

  1. Sign in to the console and open the API Key page.
  2. Click Create API Key.
  3. Enter a name, for example production-image or batch-image-jobs.
  4. Set Binding type to Image batch group.
  5. Select an available Image batch group.
  6. Optionally configure quota, rate limits, and expiration.
  7. Submit the form, then copy and store the generated key.

Image API keys are only for async image task endpoints:

EndpointDescription
POST /v1/images/tasksSubmit an async image task.
GET /v1/images/tasks/{task_id}Retrieve task status and result.
POST /v1/images/tasks/{task_id}/cancelCancel a queued task.
GET /v1/images/tasks/eventsSubscribe to task events for the current key.

Example:

bash
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

RequirementUse
Claude Code, Codex CLI, Chat Completions, ResponsesGeneral API key
Model listing and usage queriesGeneral API key
Synchronous OpenAI image generation or editsGeneral API key with an OpenAI group that supports images
Long-running or production async image generationImage API key
Async image generation with gemini-2.5-flash-image or gemini-3.1-flash-imageImage API key bound to a batch group that includes the model

Common Issues

SymptomCause and fix
/v1/images/tasks returns an unsupported-feature or permission errorYou are using a general API key. Create and use an image API key bound to an image batch group.
The image model is unavailableThe 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 workImage API keys are only for async image tasks. Use a general API key for text APIs.
No image batch groups appear in the dropdownThe administrator has not exposed an available image batch group, or your account does not have permission to use one.