Skip to content

GPT-Image-2 with the TokenPilot relay

Call the GPT-Image-2 image-generation API through TokenPilot to create high-quality AI images.

Live syncGET /v1/models
Click a model name to copy

Models available on TokenPilot

34 models spanning the OpenAI GPT and Anthropic Claude families, all served from https://go.aitokenpilot.com/v1.

OpenAI · GPT

22 models

For OpenAI-protocol clients: Codex, Cursor, Cline, Cherry Studio, and more

Chat & reasoning

General chat, reasoning, long context

o-series (deep reasoning)

Complex reasoning, math, coding

Coding

Codex series — code generation & refactoring

Multimodal (audio / realtime)

Realtime voice, audio in/out

Image generation

Text-to-image, image editing

Anthropic · Claude

12 models

For Anthropic-protocol clients: Claude Code, CC Switch, Hermes, and more

Opus (flagship reasoning)

Top-tier reasoning and coding for complex tasks

Sonnet (balanced workhorse)

Balanced speed and quality — the daily driver

Haiku (lightweight & fast)

Fast, low-cost responses for simple tasks

What is GPT-Image-2

GPT-Image-2 is OpenAI's latest image-generation model, supporting text-to-image, image editing, style transfer and more, with a big jump in output quality and controllability.

High-quality output

Up to 4K resolution with rich detail

Precise control

Supports local edits, style direction, and composition control

Multimodal understanding

Understands complex prompts and generates images that match your intent

API access

Get your API key

Visit the TokenPilot console, sign up, and get your API key.

Call the API

Use the standard OpenAI image-generation endpoint:

bash
curl https://go.aitokenpilot.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxx" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A serene Japanese garden with cherry blossoms",
    "n": 1,
    "size": "1024x1024",
    "quality": "hd"
  }'

Handle the response

The API returns the URL or Base64 encoding of the generated image:

json
{
  "created": 1234567890,
  "data": [
    {
      "url": "https://..."
    }
  ]
}

Image generation

  • Supported sizes: 256x256, 512x512, 1024x1024, 1024x1792, 1792x1024
  • Quality options: standard or hd — HD produces more detail but uses more quota
  • Style options: vivid or natural — affects the overall look of the image

Image editing

Use the /v1/images/edits endpoint to edit images:

bash
curl https://go.aitokenpilot.com/v1/images/edits \
  -H "Authorization: Bearer sk-xxx" \
  -F image="@original.png" \
  -F mask="@mask.png" \
  -F prompt="Add a rainbow in the sky" \
  -F model="gpt-image-2" \
  -F n=1 \
  -F size="1024x1024"

TIP

In the mask image, transparent areas mark the parts to edit; opaque areas are kept as-is.

Best practices

Prompting tips

  • Be specific and detailed: include the subject, setting, lighting, and style
  • Use artistic terms: e.g. "cinematic lighting", "oil painting style"
  • Avoid negatives: say "clear sky" rather than "sky with no clouds"
  • Reference artist styles: e.g. "in the style of Studio Ghibli"