API Quickstart

One entry point, one slug. Get a key → send one request → get results; to switch channels, just change one slug.

Get an API key

Log in to Console → API Keys to create a key. pk_live is for the frontend, sk_live for the server side.

Send one request

Send your prompt and a channel slug to the hub entry point; the hub dispatches automatically by modality and health.

Get results / metering

Returns the result and the Prisms consumed. If a channel fails it auto-reroutes — transparent metering.

Minimal request · curl

A minimal runnable image-generation request. Just replace YOUR_API_KEY with your key.

curl -X POST https://api.refractnest.dev/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "forge-pro",
    "prompt": "a cozy pixel-art control tower at sunrise",
    "n": 1
  }'
Response (200)
{
  "task_id": "t_9af31c",
  "model": "forge-pro",
  "status": "done",
  "cost_prisms": 8,
  "data": [{ "url": "https://cdn.refractnest.dev/o/9af31c.png" }]
}

Endpoints

Endpoints
MethodEndpointPurpose
POST/v1/images/generationsImage generation (with model slug)
GET/v1/tasks/{task_id}Query task status and result
GET/v1/modelsList available channels and Prisms
GET/v1/account/balanceQuery Prisms balance (free + purchased buckets)

Available channel slugs

Replace model with any slug below to switch the AI channel behind it. Full list and health on the Models page

Available channel slugs
slugModalityEachStatus
forge-v8 IMAGE 10 Prisms Healthy
forge-v7 IMAGE 8 Prisms Healthy
forge-v6 IMAGE 6 Prisms Healthy
prism-type IMAGE 6 Prisms Degraded
lumen-pro TEXT 2 Prisms Degraded
lumen-lite TEXT 1 Prisms Degraded
prism-art IMAGE 5 Prisms Degraded
lumen-flash TEXT 1 Prisms Degraded
lumen-max TEXT 3 Prisms Degraded
prism-hd IMAGE 5 Prisms Degraded

Ready to fire your first request?

Log in to Console for a key · 50 free Prisms daily · one entry point to every major AI.

▶ Get API Key