API Reference
Cortex Asset API — REST endpoints for searching, previewing, and downloading game assets. Base URL: https://api.cortexassets.com/v1
Authentication
All API requests require a Bearer token. Include your API key in the Authorization header. You can generate and manage API keys from your dashboard.
curl https://api.cortexassets.com/v1/account \
-H "Authorization: Bearer YOUR_API_KEY"Requests without a valid API key return 401 Unauthorized.
Search
/v1/assets/searchSearch the asset library. Returns up to 50 results by default. Search and preview are free — no credits consumed.
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Search query (e.g. "fire icon", "forest ambience") |
| type | string | No | Asset type: image, audio, model, font |
| assetClass | string | No | Sub-class: sprite, tileset, sfx, music, etc. |
| style | string | No | Visual style: pixel-art, realistic, cartoon, etc. |
| category | string | No | Category tag, e.g. characters, ui, environment |
| theme | string | No | Theme tag, e.g. fantasy, sci-fi, medieval |
| license | string | No | Filter by license: cc0, mit, cc-by, etc. |
| limit | integer | No | Number of results (1–50, default 20) |
curl "https://api.cortexassets.com/v1/assets/search?q=fire+icon&type=image&limit=5" \
-H "Authorization: Bearer YOUR_API_KEY"{
"results": [
{
"id": "ast_01HXYZ123",
"title": "Flame Icon",
"type": "image",
"assetClass": "sprite",
"style": "pixel-art",
"license": "cc0",
"previewUrl": "https://cdn.cortexassets.com/preview/ast_01HXYZ123.webp",
"creditCost": 5
}
],
"total": 42,
"limit": 5,
"offset": 0
}Asset Metadata
/v1/assets/{id}Retrieve full metadata for a single asset including all tags, dimensions, and license details.
curl https://api.cortexassets.com/v1/assets/ast_01HXYZ123 \
-H "Authorization: Bearer YOUR_API_KEY"{
"id": "ast_01HXYZ123",
"title": "Flame Icon",
"description": "Animated pixel-art flame sprite, 32x32.",
"type": "image",
"assetClass": "sprite",
"style": "pixel-art",
"category": "effects",
"theme": "fantasy",
"license": "cc0",
"licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/",
"format": "png",
"width": 32,
"height": 32,
"fileSize": 2048,
"creditCost": 5,
"previewUrl": "https://cdn.cortexassets.com/preview/ast_01HXYZ123.webp",
"createdAt": "2025-11-15T08:22:00Z"
}Preview
/v1/assets/{id}/previewReturns a 302 redirect to a preview file. Always free — no credits consumed.
- Images: Watermarked WebP thumbnail
- Audio: Clipped MP3 (first 15 seconds)
- 3D models: Rendered PNG thumbnail
- Fonts: PNG specimen card
curl -L https://api.cortexassets.com/v1/assets/ast_01HXYZ123/preview \
-H "Authorization: Bearer YOUR_API_KEY" \
-o preview.webpDownload
/v1/assets/{id}/downloadDownload the original asset file. Costs 5 credits per download. Returns a 302 redirect to a signed URL (valid for 60 seconds). Returns 402 if your balance is insufficient.
curl -L https://api.cortexassets.com/v1/assets/ast_01HXYZ123/download \
-H "Authorization: Bearer YOUR_API_KEY" \
-o flame-icon.png// 402 Payment Required — insufficient credits
{
"error": "insufficient_credits",
"message": "You need 5 credits to download this asset. Current balance: 3.",
"requiredCredits": 5,
"currentBalance": 3
}Account
/v1/accountReturns basic account information including your current credit balance.
curl https://api.cortexassets.com/v1/account \
-H "Authorization: Bearer YOUR_API_KEY"{
"email": "you@example.com",
"creditBalance": 145,
"createdAt": "2025-10-01T12:00:00Z"
}Usage History
/v1/account/usageReturns a paginated list of credit transactions (purchases and downloads).
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Results per page (1–100, default 50) |
| offset | integer | No | Pagination offset (default 0) |
curl "https://api.cortexassets.com/v1/account/usage?limit=50&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"{
"transactions": [
{
"id": "txn_01HABC999",
"type": "download",
"assetId": "ast_01HXYZ123",
"assetTitle": "Flame Icon",
"credits": -5,
"balanceAfter": 145,
"createdAt": "2026-01-10T14:33:00Z"
},
{
"id": "txn_01HABC888",
"type": "purchase",
"credits": 500,
"balanceAfter": 150,
"createdAt": "2026-01-09T09:00:00Z"
}
],
"total": 24,
"limit": 50,
"offset": 0
}Errors
All errors return JSON with error and message fields.
| Status | Error code | Description |
|---|---|---|
| 400 | bad_request | Missing or invalid parameters. |
| 401 | unauthorized | Missing or invalid API key. |
| 402 | insufficient_credits | Not enough credits to complete the download. |
| 404 | not_found | The requested asset does not exist. |
| 429 | rate_limited | Too many requests. Retry after the Retry-After header value. |