GraphiCoal Image API
AI image generation, editing, analysis, and SVG vectorization powered by FLUX and vtracer. Create and transform images programmatically using natural language prompts, perform intelligent image analysis, and convert raster images to clean scalable vectors.
Base URL
https://coals.ai/api/v1/graphicoal
All endpoints require an Authorization: Bearer <token> header. Obtain a token from your dashboard API settings.
Endpoints
| Method | Endpoint | Description | Scope Required |
|---|---|---|---|
| POST | /generate | Generate images from a text prompt | graphicoal:generate |
| POST | /edit | Edit an existing image with a prompt | graphicoal:edit |
| POST | /analyze | Analyze image contents with a question | graphicoal:analyze |
| POST | /svg/generate | Generate SVG from a text prompt via FLUX + vtracer | graphicoal:generate |
| POST | /svg/convert | Convert an uploaded image to SVG via vtracer | graphicoal:convert |
| GET | /images | List generated images with optional filters | graphicoal:read |
| GET | /images/{id} | Retrieve full details for a single image | graphicoal:read |
| DELETE | /images/{id} | Permanently delete an image | graphicoal:delete |
| GET | /quota | Usage statistics and credit balance | graphicoal:read |
Required Scopes
graphicoal:generate
Generate new images from text prompts via /generate and /svg/generate.
graphicoal:edit
Edit existing images with prompt-driven modifications via /edit.
graphicoal:analyze
Analyze and describe image contents via /analyze.
graphicoal:convert
Convert uploaded raster images to SVG vectors via /svg/convert.
graphicoal:read
Read image gallery, retrieve image details, and check quota via /images and /quota.
graphicoal:delete
Permanently delete images from your gallery via DELETE /images/{id}.
Credit Costs
| Operation | Credits | USD Equivalent |
|---|---|---|
Generate image (/generate) |
2 cr | $0.02 |
Edit image (/edit) |
3 cr | $0.03 |
SVG generate (/svg/generate) |
3 cr | $0.03 |
SVG convert (/svg/convert) |
3 cr | $0.03 |
Analyze image (/analyze) |
1 cr | $0.01 |
Gallery reads, quota checks, and deletions do not consume credits.
Quick Start — Generate an Image
curl -X POST https://coals.ai/api/v1/graphicoal/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A serene mountain lake at sunrise, photorealistic", "width": 1024, "height": 1024 }'
// Using Guzzle $response = $client->post('https://coals.ai/api/v1/graphicoal/generate', [ 'headers' => ['Authorization' => 'Bearer YOUR_API_KEY'], 'json' => [ "prompt" => "A serene mountain lake at sunrise, photorealistic", "width" => 1024, "height" => 1024 ] ]); $data = json_decode($response->getBody(), true);
# Using requests import requests response = requests.post( "https://coals.ai/api/v1/graphicoal/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "prompt": "A serene mountain lake at sunrise, photorealistic", "width": 1024, "height": 1024 } ) data = response.json()
# Using net/http require "net/http" require "json" uri = URI("https://coals.ai/api/v1/graphicoal/generate") req = Net::HTTP::Post.new(uri) req["Authorization"] = "Bearer YOUR_API_KEY" req["Content-Type"] = "application/json" req.body = '{ "prompt": "A serene mountain lake at sunrise, photorealistic", "width": 1024, "height": 1024 }' res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) } data = JSON.parse(res.body)
// Using fetch (Node 18+) const response = await fetch("https://coals.ai/api/v1/graphicoal/generate", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ "prompt": "A serene mountain lake at sunrise, photorealistic", "width": 1024, "height": 1024 }) }); const data = await response.json();