Skip to content

Create API Keys

Before calling LLMAPI, create the correct API key type in the console.

TypeBound toPrimary use
General API keyGeneral groupText APIs, model listing, usage queries, synchronous platform image endpoints, and other regular gateway APIs.
Task API keyPer-model Task PlansLong-running image, video, and other media jobs through /v1/tasks, plus task retrieval, cancellation, SSE updates, asset downloads, and OpenAI Images compatible synchronous endpoints.

The bindings are mutually exclusive. A general API key cannot submit tasks. A Task API key can only access /v1/tasks*, POST /v1/images/generations, and POST /v1/images/edits.

Create a General API Key

Use a general API key for text models, OpenAI-compatible APIs, Anthropic Messages, Gemini Native, and synchronous platform 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, /v1/images/edits
Anthropic/v1/messages, /v1/messages/count_tokens
Gemini/v1beta/models, /v1beta/models/{model}:generateContent, /v1beta/models/{model}:streamGenerateContent

Use the key like this:

bash
curl https://api.llmapi.site/v1/models \
  -H 'Authorization: Bearer YOUR_API_KEY'

Create a Task API Key

Use a Task API key for long-running image, video, and other media jobs. The key may select a Task Plan separately for each model. Models without an explicit selection follow their model-specific default plan.

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-media or media-jobs.
  4. Select the Task key type. Optionally choose a plan for each model under Model plans; leave a model on Follow default to use its current default plan.
  5. Optionally configure quota, rate limits, and expiration.
  6. Submit the form, then copy and store the generated key.

One key may use different plans for different models—for example, an economy plan for gpt-image-2 and a stability plan for seedance. The request protocol stays the same: do not add a plan parameter or modify the model name. Before submitting a task, use GET /v1/tasks/models with that key to read each model's effective price and parameter constraints.

If an explicit selection is disabled, deleted, or no longer supports that model, that model returns to its own default plan without changing other model selections. Existing keys also follow the default automatically when an administrator adds a new model.

Task API keys are only for these public endpoints:

EndpointDescription
POST /v1/tasksSubmit a task.
GET /v1/tasks/modelsList executable models, prices, and parameter constraints for the current key.
GET /v1/tasks/{id}Retrieve task status and result.
GET /v1/tasks/eventsSubscribe to task updates for the current key.
GET /v1/tasks/{id}/assets/{index}Download a result asset.
POST /v1/tasks/{id}/cancelCancel a queued task.
POST /v1/images/generationsOpenAI Images compatible generation request. Waits synchronously for up to 120 seconds.
POST /v1/images/editsOpenAI Images compatible edit request. Waits synchronously for up to 120 seconds.

Example:

bash
curl https://api.llmapi.site/v1/tasks \
  -H 'Authorization: Bearer YOUR_TASK_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-image-2",
    "modality": "image",
    "params": {
      "model": "gpt-image-2",
      "prompt": "a clean studio product photo of a matte black water bottle",
      "n": 1,
      "image_size": "1K",
      "aspect_ratio": "1:1"
    }
  }'

Which One to Use

RequirementUse
Claude Code, Responses, Chat Completions, MessagesGeneral API key
Model listing and usage queriesGeneral API key
Synchronous OpenAI image generation or editsGeneral API key with an OpenAI group that supports images
Existing OpenAI Images generation or edit clientTask API key calling POST /v1/images/generations or POST /v1/images/edits
Gemini image generation or multimodal generationGeneral API key with a Gemini group
Long-running production image or video jobsTask API key
Batch image jobs with Gemini or OpenAI image modelsTask API key; optionally select a plan for that model or follow its model default

Common Issues

SymptomCause and fix
/v1/tasks returns TASK_SCOPE_REQUIREDYou are using a general API key. Create and use a Task API key.
Regular model endpoints return task_key_onlyYou are using a Task API key. Use a general API key for text and conversation endpoints. Task keys only add OpenAI Images compatible access for POST /v1/images/generations and POST /v1/images/edits.
The task model is unavailableThe model has no active default plan/available route, or the model name is incorrect. Check GET /v1/tasks/models with the same key.
params.model must match modelMake params.model identical to the top-level model, or omit params.model.