Documentation

Send your first request.

Set the base URL, SEKAI API key, and model ID in the OpenAI SDK. Or use the cURL example below.

01

Get an API key

Open the API key page from the dashboard. Store it as an environment variable, and never put the key in source code.

export SEKAI_API_KEY="sk-sekai-..."
02

Send a request

Use the chat completions endpoint. This example uses cURL, but the OpenAI SDK is directly compatible too.

Terminal
curl https://api.sekaigateway.xyz/v1/chat/completions \
  -H "Authorization: Bearer $SEKAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt/gpt-5-mini",
    "messages": [{"role":"user","content":"Halo!"}]
  }'
03

Choose another model

Replace the model value with an ID from the catalog. The endpoint and API key stay the same.

Explore all models

PIXEL FOR DEVELOPERS

Use Pixel in your app

Buy a Pixel plan, then use your account’s SEKAI API key. The web studio and API share the same credits; each successful image uses one credit.

Shared credits with the studioYour own SEKAI API key
View API key
POST /v1/images/generations
curl https://api.sekaigateway.xyz/v1/images/generations \
  -H "Authorization: Bearer $SEKAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "pixel/gpt-image-2",
    "prompt": "A cozy coffee shop beside a lake, watercolor",
    "n": 1, "size": "1024x1024", "quality": "low"
  }'
Models, response format & retries

API models: pixel/gemini-2.5-flash-image, pixel/gemini-3.1-flash-image, pixel/gpt-image-2.

The image is returned in data[0].b64_json. Supports one image per request, size 1024×1024, quality low, and response_format b64_json. Read your balance with GET /v1/pixel/usage using the same API key.

For safe retries, send an Idempotency-Key header with a UUID v4 generated before the request. Reuse that UUID when retrying the same request; create a new UUID for the next image. Failed requests return their credit.