CoreCodeDocs

Connect

Image generation

Last updated: November 6, 2026

CoreCode generates images through the OpenAI Images API: the GPT group has gpt-image-2, gpt-image-2.5-flare and gpt-image-2.5-sunburst, and the Grok group has grok-imagine-image. Call them with the OpenAI SDK or curl; each image is billed at a fixed price.

Base URL
https://corecode.live/v1
Endpoints
Generate /v1/images/generations, edit /v1/images/edits
Key
Header Authorization: Bearer sk-your-key, in the model's group or in auto
Price
$0.06 per image, generation or edit; the Pricing page is the authority

Models

ModelKey groupEditsReturnsTime per image
gpt-image-2GPT or autoYesPNG, base6410 to 20 s
gpt-image-2.5-flareGPT or autoYesPNG, base6410 to 20 s
gpt-image-2.5-sunburstGPT or autoYesPNG, base6410 to 20 s
grok-imagine-imageGrok or autoNoJPEG, URL or base64About 5 s

To get a key, click "Create API key" on the API Keys page and pick the group from the table.

Generate with curl

curl https://corecode.live/v1/images/generations \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2.5-flare", "prompt": "a small red fox sitting on a rock, flat illustration", "quality": "low"}' \
  | jq -r '.data[0].b64_json' | base64 --decode > fox.png

The image comes back as base64 in data[0].b64_json. To switch models, change model.

Generate with the Python SDK

import base64
from openai import OpenAI

client = OpenAI(base_url="https://corecode.live/v1", api_key="sk-your-key", timeout=180)
r = client.images.generate(
    model="gpt-image-2.5-flare",
    prompt="a small red fox sitting on a rock, flat illustration",
    quality="low",
)
open("fox.png", "wb").write(base64.b64decode(r.data[0].b64_json))

An image takes over ten seconds, so set the client timeout to 60 seconds or more.

Edit an image

gpt-image-2, gpt-image-2.5-flare and gpt-image-2.5-sunburst can edit: as with OpenAI, upload the source image as the form field image.

curl https://corecode.live/v1/images/edits \
  -H "Authorization: Bearer sk-your-key" \
  -F model=gpt-image-2.5-flare \
  -F "prompt=give the fox a blue scarf" \
  -F quality=low \
  -F image=@fox.png \
  | jq -r '.data[0].b64_json' | base64 --decode > fox-scarf.png

In the SDK: client.images.edit(model=..., image=open("fox.png", "rb"), prompt=...).

Generate with Grok

curl https://corecode.live/v1/images/generations \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "grok-imagine-image", "prompt": "a small red fox in the snow, watercolor", "response_format": "b64_json"}' \
  | jq -r '.data[0].b64_json' | base64 --decode > fox.jpg

Pass "response_format": "b64_json". Without it you get data[0].url, a temporary xAI link that may not open from mainland China.

Parameters

ParameterBehavior
sizeIgnored by the GPT image models for now, which usually return 1536x1024; Grok returns 1280x720 when omitted. Trust the returned size
qualityGPT image models accept low, medium, high or auto; the price is the same
nGPT image models return one image per request, so leave n out and send more requests for more images
streamLeave it out; Grok rejects it
response_formatGPT image models always return base64; for Grok, pass b64_json

FAQ

Model not found or no available channel

The key's group does not have the model. GPT image models need a key in GPT or auto; grok-imagine-image needs a key in Grok or auto.

The group accepts only Claude Code requests

The key is in a Claude Code only group. Create a key in GPT, Grok or auto.

The request times out

A GPT image takes 10 to 20 seconds, longer at busy times. Raise the client timeout to 60 seconds or more.

What is the difference between flare and sunburst?

They cost the same and both generate and edit. Which looks better depends on the prompt, so try both.