Getting Started
This page covers the minimum information required to call the LLMAPI gateway. All examples use:
text
https://llmapi.siteBasics
| Item | Value |
|---|---|
| API Base URL | https://llmapi.site |
| Recommended authentication | Authorization: Bearer YOUR_API_KEY |
| Request format | application/json; image edits may use multipart/form-data |
| Streaming | Depends 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:
| Type | Best for |
|---|---|
| General API key | Text APIs, model listing, usage queries, Gemini native paths, and synchronous OpenAI image endpoints. |
| Image API key | Async 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 case | Recommended endpoint | Notes |
|---|---|---|
| Claude Code or Anthropic Messages clients | POST /v1/messages | Routed by the API key group platform. |
| Codex CLI or OpenAI Responses clients | POST /v1/responses | Compatible with the Responses API. |
| OpenAI Chat Completions clients | POST /v1/chat/completions | Works with common OpenAI-compatible clients. |
| List available models | GET /v1/models | Returns models available to the current key group. |
| Check balance, quota, and usage | GET /v1/usage | Returns quota mode and usage statistics. |
| OpenAI synchronous images | POST /v1/images/generations | Requires a general API key bound to an OpenAI group; best for short requests. |
| Async image tasks | POST /v1/images/tasks | Requires 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-imageandgemini-3.1-flash-image. - Gemini native paths require a Gemini platform group.
POST /v1/messages/count_tokensis not supported for OpenAI platform groups.- Long-running image generation should use async tasks instead of waiting inside a synchronous request.