Skip to content

Getting Started

This page covers the minimum information required to call the LLMAPI gateway. All examples use:

text
https://llmapi.site

Basics

ItemValue
API Base URLhttps://llmapi.site
Recommended authenticationAuthorization: Bearer YOUR_API_KEY
Request formatapplication/json; image edits may use multipart/form-data
StreamingDepends on the endpoint; SSE and WebSocket are supported by specific routes

Authentication Example

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

x-api-key and x-goog-api-key are also accepted for compatibility. New integrations should use Bearer tokens.

Create the Right API Key First

The console supports two API key types:

TypeBest for
General API keyText APIs, model listing, usage queries, Gemini native paths, and synchronous OpenAI image endpoints.
Image API keyAsync image tasks, task retrieval, cancellation, and task events.

To call async image tasks, create an image API key bound to an image batch group. General API keys cannot submit async image tasks.

See Create API Keys for the full steps.

Choosing an Endpoint

Use caseRecommended endpointNotes
Claude Code or Anthropic Messages clientsPOST /v1/messagesRouted by the API key group platform.
Codex CLI or OpenAI Responses clientsPOST /v1/responsesCompatible with the Responses API.
OpenAI Chat Completions clientsPOST /v1/chat/completionsWorks with common OpenAI-compatible clients.
List available modelsGET /v1/modelsReturns models available to the current key group.
Check balance, quota, and usageGET /v1/usageReturns quota mode and usage statistics.
OpenAI synchronous imagesPOST /v1/images/generationsRequires a general API key bound to an OpenAI group; best for short requests.
Async image tasksPOST /v1/images/tasksRequires an image API key bound to an image batch group; best for long-running production jobs.
Gemini native clients/v1beta/models...Requires a Gemini platform group.

Minimal Examples

Messages

bash
curl https://llmapi.site/v1/messages \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 512,
    "messages": [
      { "role": "user", "content": "Hello" }
    ]
  }'

Responses

bash
curl https://llmapi.site/v1/responses \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-5.1",
    "input": "Write a short product description."
  }'

Chat Completions

bash
curl https://llmapi.site/v1/chat/completions \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-5.1",
    "messages": [
      { "role": "user", "content": "Hello" }
    ]
  }'

Async Image Task

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
  }'

Integration Notes

  • The API key group determines the available platform and endpoint capabilities.
  • Synchronous OpenAI image endpoints require an OpenAI platform group. Async image tasks require an image API key bound to an image batch group.
  • For Gemini async image generation, use official model names such as gemini-2.5-flash-image and gemini-3.1-flash-image.
  • Gemini native paths require a Gemini platform group.
  • POST /v1/messages/count_tokens is not supported for OpenAI platform groups.
  • Long-running image generation should use async tasks instead of waiting inside a synchronous request.