API documentation
Video tasks
These docs describe APIs implemented by this platform. Query the model catalog with your key to check current protocol availability.
Before your first request
- Contact support, pay by offline transfer, then redeem your credit code. Corporate bank transfers and corporate invoices are supported. Purchase and redeem
- Create a platform API key. Set model permissions, a credit limit and an expiry date. Upstream credentials are managed by the owner; customers use platform keys.
- Read the catalog, copy the exact model ID and choose a format listed in supported_protocols.
Keep secrets in server environment variables. Login cookies, account-query tokens and model API keys serve different purposes and are not interchangeable.
set "STATION_BASE_URL=https://www.aiglobalsite.com" set "STATION_API_KEY=YOUR_PLATFORM_API_KEY" curl.exe "%STATION_BASE_URL%/v1/models" -H "Authorization: Bearer %STATION_API_KEY%"
Submit an asynchronous task
POST /v1/media/generations returns a platform task ID. Set webHook=-1 for polling; omit it for SSE progress. The platform selects the upstream provider, so clients do not call GrsAI directly.
Nano Banana imageSize depends on the model: use the matching resolution for a fixed 2K/4K variant, or omit it for the model default. Generate one image per request with n=1. GPT Image 2.6 flare/sunburst variants output GIF.
Video models require an enabled channel and pricing. This example does not imply that a video upstream is currently connected.
Call from Windows CMD
Save the JSON below as a UTF-8 file named request.json, then run the command in that directory. Replace the platform key. For local development you can also use http://127.0.0.1:8080. A CMD continuation line ends with ^ and no trailing spaces.
{
"model": "YOUR_MODEL",
"prompt": "A slow camera move across a quiet coastal town.",
"duration": 8,
"resolution": "720p",
"webHook": "-1"
}set "STATION_BASE_URL=https://www.aiglobalsite.com" set "STATION_API_KEY=YOUR_PLATFORM_API_KEY" curl.exe -N -i -X POST "%STATION_BASE_URL%/v1/media/generations" ^ -H "Authorization: Bearer %STATION_API_KEY%" ^ -H "Content-Type: application/json" ^ --data-binary "@request.json"
{
"code": 0,
"msg": "success",
"data": {
"id": "task_REPLACE_WITH_RETURNED_ID"
}
}curl.exe "%STATION_BASE_URL%/v1/tasks/task_REPLACE_WITH_RETURNED_ID" -H "Authorization: Bearer %STATION_API_KEY%"
Handle completion and failures
Poll every 2–5 seconds. Read data.status: keep waiting for running/processing; succeeded/completed means completion, with URLs in data.results[].url; stop on failed/violation; needs_review requires owner review. Result URLs can expire, so save results promptly. Disconnecting SSE does not cancel the upstream task.
A task ID is bound to its original user and API key. Do not use an upstream task ID or resubmit just because generation takes time. External webhooks, oss-id auto-storage, file uploads and image-edit endpoints are not available.
Errors and billing
| HTTP | What to do |
|---|---|
| 400 | Check JSON, model and parameters; the model may be under maintenance. |
| 401 / 403 | Check the key, expiry, account status and model permissions. |
| 402 | Account balance or key quota is insufficient. Contact support for a credit code. |
| 409 | This API key already used the Idempotency-Key. The request is not forwarded again; the original response is not replayed. |
| 413 / 429 | Maximum request body: 1 MiB. Back off when rate or concurrency limits are reached. |
| 502 / 503 | Upstream failure or no available channel. Keep X-Request-ID and check logs before retrying. |
Credits are reserved before a request and settled afterward. Explicit failures release the hold; missing usage or an uncertain submission requires review. Generation is not automatically retried. Use an Idempotency-Key of up to 128 characters to prevent duplicate submissions.