# Getting started
Create a skybox generation with the Skybox AI API, wait until it completes, then use the image URL.
For agents
Index: /llms.txt. Skill: Agent skill. MCP is still being worked on.
# 1. Get an API key
Create a key at skybox.blockadelabs.com/api (opens new window).
Do not put your API key in frontend code or AI chat apps. Call the API from your backend, or use an SDK. Full rules: Security.
# 2. Authenticate
Send the key in the x-api-key header (preferred).
| Header | Value |
|---|---|
x-api-key | your-api-key |
You can also send api_key as a query parameter. That is less secure (keys leak into logs and browser history).
POST bodies can be JSON (application/json) or FormData (multipart/form-data). If you use JSON and upload a file, encode the file as base64.
# 3. Create your first generation
POST https://backend.blockadelabs.com/api/v1/skybox
skybox_style_id is required. Get style IDs from Get Skybox Styles. For how to write prompts for Model 3 vs Model 4, see Prompting.
{
"skybox_style_id": 155,
"prompt": "lonely lighthouse on a rocky coast at dusk"
}
curl -X POST "https://backend.blockadelabs.com/api/v1/skybox" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"skybox_style_id":155,"prompt":"lonely lighthouse on a rocky coast at dusk"}'
Model 4 also accepts variant_id. See Quality.
# Response example
{
"id": 123456,
"status": "pending",
"queue_position": 2,
"file_url": "",
"thumb_url": "",
"title": "Generation #123456",
"user_id": 1,
"username": "user@blockadelabs.com",
"error_message": null,
"obfuscated_id": "460370b7328a5cb8dbddd6ef0d1c9dd4",
"pusher_channel": "status_update_460370b7328a5cb8dbddd6ef0d1c9dd4",
"pusher_event": "status_update",
"created_at": "2023-03-18T10:42:19+00:00",
"updated_at": "2023-03-18T10:42:19+00:00"
}
After this response, wait for the generator to finish. When status is complete, use file_url for the skybox image.
# 4. Wait for completion
Statuses move: pending → dispatched → processing → complete (or abort / error).
# Pusher (recommended)
Subscribe with an official Pusher library (opens new window) using pusher_channel and pusher_event from the response.
app_id = "1555452"
key = "a6a7b7662238ce4494d5"
cluster = "mt1"
# Webhook
Send webhook_url on the generation request. We POST JSON status updates to that URL. Failed deliveries retry up to 4 times after the first attempt (5 total) with backoff: 1m, 5m, 15m, 1h.
Webhooks include x-timestamp and x-signature. Signatures use the API secret from skybox.blockadelabs.com/api (opens new window).
$receivedTimestamp = $request->header('X-Timestamp');
$receivedSignature = $request->header('X-Signature');
$body = $request->getContent();
if (abs(time() - (int)$receivedTimestamp) > 300) {
return response()->json(['error' => 'Expired webhook'], 403);
}
$expectedSignature = hash_hmac('sha256', $body, $yourApiSecret);
if (!hash_equals($expectedSignature, $receivedSignature)) {
return response()->json(['error' => 'Invalid signature'], 403);
}
Test with webhook.site (opens new window).
# Polling (testing only)
GET https://backend.blockadelabs.com/api/v1/imagine/requests/{id} — see Get Skybox by id. Polling can hit rate limits; prefer Pusher or webhooks.
If the user needs an output in a given time, pass max_wait (Fast 60s · Balance 120s · Detail 240s). Omit it if they can wait. The job then errors and credits refund.
# Implementation considerations
Putting Generate in a product is more than a successful POST. Keep the key on the server, analogue a Prompt bar or Wizard, and limit how often your app will generate. A 429 means the queue is full, and spending continues when a job finishes. Wait with Pusher or a webhook, and show errors the user can act on.
Keep the key on your server and limit how often Generate can run. Details are in this section.
# Terminology
| In the app | In the API |
|---|---|
| Generation #N | title, id |
| skybox | file_url / completed generation asset |
| credits | plan usage; variant costs |
| API key | x-api-key |
| Remix / Create New | remix params / generate routes |
# Key tools and exports
| Tool | Docs |
|---|---|
| Create | Generate Skybox · Prompting |
| Remix | Generate Skybox (remix / control / init) · Gallery starters · Web |
| Edit / Image2Pano | Edit · Image2Pano |
| Export | Docs |
|---|---|
| JPG / PNG · HDRI · Cube map · Depth | Skybox exports |
| Video · GLB | Skybox exports |