Silico Grove API Integration Guide
Integrate text, image, video, and audio capabilities through the endpoint matching each feature. Preserve request field names exactly.
| Item | Value |
|---|---|
| Primary Base URL | https://ai.silicogrove.com/v1 |
| Backup Base URL | https://api.silicogrove.com/v1 when the primary domain is unavailable |
| Authentication | Authorization: Bearer YOUR_API_KEY |
| JSON requests | Content-Type: application/json |
| File uploads | multipart/form-data |
Start with Quick start, then confirm access in Models and access.
Quick Start
Follow the steps from creating an API key to making your first request.
- Create and securely store an API key in the console.
- List the models available to that key.
- Send requests to the matching capability endpoint.
Do not duplicate the Base URL
The OpenAI SDK base_url includes /v1. Do not append /v1 again when composing complete endpoint URLs. The backup address requires client-side failover configuration.
List available models
curl -X GET "https://ai.silicogrove.com/v1/models" \
-H "Authorization: Bearer YOUR_API_KEY"Minimal text request
curl -X POST "https://ai.silicogrove.com/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"Hello, reply in one sentence."}]}'Python OpenAI SDK
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://ai.silicogrove.com/v1")
response = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Hello, reply in one sentence."}],
)
print(response.choices[0].message.content)Models and Access
Check available models before calling an API to confirm access for your account and key.
Available models depend on your account, group, and API key permissions. Treat GET /v1/models as the source of truth.
| Capability | Typical models | Endpoint |
|---|---|---|
| Text | gpt-5.4-mini, Claude, Gemini | /v1/chat/completions |
| Images | gpt-image-2, Gemini image models, grok-imagine-image | Recommended async /v1/images/tasks; sync /v1/images/generations |
| Video | Recommended: grok-video-1.5 (only 6, 8, 10, 12, or 15 seconds), kling-video-v3, video-ds-2.0, as-sd2.0-fast; grok-imagine-video, grok-imagine-video-1.5 (currently unavailable) | /v1/videos |
| Audio | Check the returned model list | /v1/audio/* |
Text
Send text or supported multimodal content through the chat API to receive model responses.
Chat Completions
curl -X POST "https://ai.silicogrove.com/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-mini","messages":[{"role":"system","content":"You are a concise assistant."},{"role":"user","content":"Write a product introduction."}],"stream":false}'Responses API
curl -X POST "https://ai.silicogrove.com/v1/responses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-mini","input":"Introduce yourself in one sentence."}'Async Image Generation and Editing (Recommended)
Image generation time varies, so asynchronous tasks suit API integrations: submit first, then query for the result.
Use asynchronous tasks to generate and edit images. Submit a task, receive its ID, then query for the result without holding a synchronous request open.
| Goal | Complete workflow |
|---|---|
| Edit a local image | Upload reference → Submit task → Poll task |
| Generate from text | Submit task → Poll task |
Each code block is an independent curl command. Replace its placeholders and paste it directly into a terminal; no variable setup is needed. Replace YOUR_API_KEY in every command with your API key.
Editing: Upload reference → Submit task → Poll task
Step 1: Upload two local reference images separately
Use the first image for the subject and the second for the background. Replace each file path with a real file on your computer.
Upload the subject image:
curl --request POST \
'https://ai.silicogrove.com/pg/assets' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--form 'kind=image' \
--form 'file=@/path/to/subject.jpg'Upload the background image:
curl --request POST \
'https://ai.silicogrove.com/pg/assets' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--form 'kind=image' \
--form 'file=@/path/to/background.jpg'Each upload returns its own data.url. Replace YOUR_SUBJECT_IMAGE_URL in the JSON below with the subject upload URL and YOUR_BACKGROUND_IMAGE_URL with the background upload URL. If either upload fails, resolve the error before submitting.
Step 2: Submit the editing task
curl --request POST \
'https://ai.silicogrove.com/v1/images/tasks' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-image-2",
"prompt": "Keep the subject from the first reference image and place it naturally into the background from the second reference image, matching lighting, perspective, and shadows",
"images": [
{"image_url": "YOUR_SUBJECT_IMAGE_URL"},
{"image_url": "YOUR_BACKGROUND_IMAGE_URL"}
],
"size": "1024x1024",
"quality": "high",
"n": 1
}'A successful submission returns HTTP 202. Copy its id. This means the task was accepted; the image is not ready yet.
The first images item is the subject and the second is the background, matching the prompt. n: 1 requests one output image; it does not limit the reference count to one. For a single reference, upload one file and keep only the first array item. Upload and append further references the same way, up to 10.
Step 3: Poll the editing task
Replace YOUR_TASK_ID in the URL with the complete id returned by Step 2:
curl --request GET \
'https://ai.silicogrove.com/v1/images/tasks/YOUR_TASK_ID' \
--header 'Authorization: Bearer YOUR_API_KEY'Repeat the query every 2 to 5 seconds. Keep waiting for queued / processing; stop on completed and download the images from data[].url, or stop on failed and read error.message. On an HTTP error, inspect the response instead of automatically resubmitting a generation task.
Text-to-image: Submit task → Poll task
Step 1: Submit the generation task
Send the prompt and generation parameters. Omit images; do not send images: [], image, or mask.
curl --request POST \
'https://ai.silicogrove.com/v1/images/tasks' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-image-2",
"prompt": "A cat sitting by a window, realistic photography",
"size": "1024x1024",
"quality": "high",
"n": 1
}'Step 2: Poll the generation task
Replace YOUR_TASK_ID in the URL with the complete id returned by this submission:
curl --request GET \
'https://ai.silicogrove.com/v1/images/tasks/YOUR_TASK_ID' \
--header 'Authorization: Bearer YOUR_API_KEY'Repeat the query every 2 to 5 seconds. Keep waiting for queued / processing; stop on completed and download the images from data[].url, or stop on failed and read error.message. On an HTTP error, inspect the response instead of automatically resubmitting a generation task.
Request parameters
Common headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer YOUR_API_KEY. Required for upload, submission, and retrieval. Only the task owner can retrieve the task. |
Content-Type | string | For JSON submission | Use application/json to submit JSON. For uploads, let curl -F generate multipart/form-data and its boundary. GET retrieval needs no Content-Type header. |
Upload reference: POST /pg/assets
Use a multipart form. Upload one image per request; upload multiple references separately.
| Parameter | Type | Required | Values or limits | Description |
|---|---|---|---|---|
kind | string | Yes | image | Identifies the upload as an image reference. |
file | file | Yes | JPEG, PNG, WebP; nonempty, up to 10 MiB | A local image file. Use curl --form 'file=@/local/path/image.jpg', then read data.url from the successful response. |
Submit task: POST /v1/images/tasks
These parameters apply to the JSON workflows above. Supported sizes, quality levels, and advanced options vary by model; do not send every optional parameter by default.
| Parameter | Type | Required | Values or limits | Description |
|---|---|---|---|---|
model | string | Yes | Available via GET /v1/models | The image model, such as gpt-image-2. |
prompt | string | Yes | Nonempty text | Generation or editing instructions. For multiple images, describe the role of each reference in array order. |
images | object[] | For editing | 1 to 10 items | Reference images. Omit this field entirely for text-to-image; do not send an empty array. Reference count is independent of output count n. |
images[].image_url | string | In every item | Use the upload response's data.url | Reference image URL. Each object must contain only this field. The API also accepts a complete image data URL; this workflow consistently uploads local files first. |
n | integer | No | Defaults to 1; explicitly send 1 to 10 | Requested output image count. Use 1 for Gemini image models; other models may impose a smaller limit. |
size | string | No | For example 1024x1024, 1536x1024, 1024x1536 | Output size. Supported values and omission behavior depend on the model. Examples explicitly use 1024x1024. |
quality | string | No | For example auto, low, medium, high; Gemini supports 1k, 2k, 4k | Output quality or resolution tier, depending on the model. Examples use high; models do not necessarily support the same values. |
stream | boolean | No | Omit or use false | Retrieve async results by polling; true is unsupported. |
response_format | string | No | Omit for these workflows | May affect the upstream response, but async tasks always return stored data[].url values, not base64 output. |
background | string | No | Commonly auto, opaque, transparent | Background mode, supported only by some models. |
output_format | string | No | Commonly png, jpeg, webp | Output image format, supported only by some models. |
output_compression | integer | No | Usually 0 to 100 | JPEG/WebP compression quality, supported only by some models. |
style | string | No | Commonly vivid, natural | Image style, supported only by some models. |
moderation | string | No | Commonly auto, low | Moderation strength, supported only by some models. |
input_fidelity | string | No | Commonly low, high | Editing reference fidelity, supported only by some models. |
mask | string | No | A mask reference supported by the model | Specifies the editing area and requires reference images. Not needed for this two-image example. Unsupported for Gemini edits. |
YOUR_API_KEY, YOUR_SUBJECT_IMAGE_URL, YOUR_BACKGROUND_IMAGE_URL, and YOUR_TASK_ID are placeholders to replace. Image URLs must come from Step 1 upload responses; task IDs must come from submission responses. Do not pass local file paths as images[].image_url.
Poll task: GET /v1/images/tasks/{task_id}
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
task_id | URL path | string | Yes | The id returned by submission, such as task_0123456789abcdef. Send no request body. Use the actual ID returned for this task. |
Query every 2 to 5 seconds and stop on completed or failed. See “Task response reference” below for status, output, and error fields.
Parameters and limits
- Available models depend on
GET /v1/models. Examples usegpt-image-2; Gemini image models requiren: 1. See image parameters. - R2 storage must be enabled. Omit
streamor set it tofalse. Tasks becomecompletedafter results are stored; provider or storage failures refund the reserved quota. - Upload JPEG, PNG, or WebP images, up to
10 MiBeach. JSON edits useimages[].image_url, not a standaloneimage, string arrays, or extra object fields. Gemini edits do not supportmask. - Uploaded references and output URLs are temporary. Download results promptly. See reference assets for upload details.
Task response reference
Submission response
A successful submission returns HTTP 202 Accepted:
{
"id": "task_0123456789abcdef",
"object": "image.task",
"status": "queued",
"progress": "0%",
"created_at": 1786192453,
"started_at": 0,
"completed_at": 0
}Retrieve and poll
curl "https://ai.silicogrove.com/v1/images/tasks/task_0123456789abcdef" \
-H "Authorization: Bearer YOUR_API_KEY"Only the user who created a task can retrieve it. Poll every 2 to 5 seconds; avoid high-frequency concurrent polling.
| Field | Type | Present when | Description |
|---|---|---|---|
id | string | Always | Public task ID in task_... format. |
object | string | Always | Always image.task. |
status | string | Always | queued, processing, completed, or failed. |
progress | string | Always | Percentage string such as 0%, 10%, or 100%. |
created_at | integer | Always | Task submission Unix timestamp. |
started_at | integer | Always | Execution start Unix timestamp, or 0 before execution. |
completed_at | integer | Always | Terminal Unix timestamp, or 0 before completion. |
created | integer | Success | Creation timestamp from the image result. |
data | array | Success | Image results; read the output from data[].url. |
error.message | string | Failure | Task failure reason. |
error.type | string | Failure | Currently image_task_failed. |
status | Meaning | Terminal |
|---|---|---|
queued | Waiting for a worker | No |
processing | Calling the provider or storing output | No |
completed | Finished; data[].url is available | Yes |
failed | Failed; inspect error | Yes |
Completed response:
{
"id": "task_0123456789abcdef",
"object": "image.task",
"status": "completed",
"progress": "100%",
"created_at": 1786192453,
"started_at": 1786192455,
"completed_at": 1786192550,
"created": 1786192548,
"data": [{"url": "https://file.lunadownload.com/temporary/2026/08/12/uuid.png"}]
}Failed response:
{
"id": "task_0123456789abcdef",
"object": "image.task",
"status": "failed",
"progress": "100%",
"created_at": 1786192453,
"started_at": 1786192455,
"completed_at": 1786192550,
"error": {"message": "upstream request failed", "type": "image_task_failed"}
}Async HTTP status codes
| Status | Scenario |
|---|---|
202 | Task created. |
400 | Invalid parameters, multipart file, n, or stream. |
403 | API key, quota, group, or model access denied. |
404 | Task is absent, has a different type, or belongs to another user. |
429 | Request or model concurrency limit reached. |
503 | R2 storage required by async tasks is not configured or available. |
Submission or retrieval failures that occur before a task response use this error envelope:
{
"error": {
"message": "R2 storage is required for asynchronous image tasks",
"type": "storage_unavailable",
"code": "storage_unavailable"
}
}There is currently no /v1/images/tasks/{task_id}/content endpoint. Download data[].url from the completed response directly.
Synchronous Images
Synchronous endpoints wait for images within a single request, for clients that need a synchronous response.
Start with async image tasks: upload → submit → poll for editing, or submit → poll for text-to-image. This section covers synchronous endpoints and the native Gemini protocol.
List models with your API key before use; its GET /v1/models response is the source of truth.
curl "https://ai.silicogrove.com/v1/models" \
-H "Authorization: Bearer YOUR_API_KEY"| Model | Generate | Edit | OpenAI image API | Native Gemini API |
|---|---|---|---|---|
gpt-image-2 | Yes | Yes | Yes | No |
gpt-image-2-all | Depends on visibility in /v1/models | Depends on upstream | Yes | No |
gemini-3-pro-image | Yes | Yes | Yes | Yes |
gemini-3.1-flash-image | Yes | Yes | Yes | Yes |
gemini-3-pro-image-preview | Yes | Yes | Yes | Yes |
gemini-3.1-flash-image-preview | Yes | Yes | Yes | Yes |
gemini-2.5-flash-image | Yes | Yes | Yes | Yes |
grok-imagine-image, grok-imagine-image-pro | Depends on visibility in /v1/models | Depends on upstream | Yes | No |
Use https://ai.silicogrove.com as the primary Base URL and https://api.silicogrove.com as an explicit backup. All requests use Authorization: Bearer YOUR_API_KEY.
OpenAI-compatible generation
This interface works with gpt-image-2 and Gemini image models.
curl "https://ai.silicogrove.com/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A premium product poster, realistic photography, clean background",
"size": "1024x1024",
"quality": "high",
"n": 1,
"response_format": "url"
}'Gemini model example:
curl "https://ai.silicogrove.com/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image",
"prompt": "A 16:9 neon city in the rain at night",
"size": "1792x1024",
"quality": "2k",
"n": 1,
"response_format": "url"
}'OpenAI-compatible editing
Use multipart form data. Do not set Content-Type manually; curl or your SDK must generate the multipart boundary.
curl "https://ai.silicogrove.com/v1/images/edits" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=gpt-image-2" \
-F "prompt=Keep the subject and change the background to a city at night" \
-F "image=@/path/to/input.png" \
-F "size=1024x1024" \
-F "quality=high" \
-F "n=1"For Gemini, change model to gemini-3.1-flash-image and use quality=2k.
Supported input formats are PNG, JPG, JPEG, and WebP. The playground currently accepts up to 3 reference images per request, up to 10 MB each.
OpenAI image parameters
The gateway accepts the common fields below. Individual models may support only a subset; an upstream may ignore or reject unsupported values. Treat /v1/models and the model's actual response as authoritative.
| Field | Type | Required | Common values or limits | Description |
|---|---|---|---|---|
model | string | Yes | From GET /v1/models | Image model name. |
prompt | string | Yes | Natural-language text | Generation or editing instruction. |
n | integer | No | 1 to 10; default 1 | Number of images. Gemini image models require 1; other models may impose lower limits. |
size | string | No | Common: 1024x1024, 1536x1024, 1024x1536, 1792x1024, 1024x1792 | Size or aspect-ratio mapping is model-dependent. DALL-E models enforce narrower enums. |
quality | string | No | Common: auto, low, medium, high, standard, hd, 1k, 2k, 4k | Quality or output-resolution tier. Upstream case sensitivity may differ. |
response_format | string | No | url, b64_json | Desired synchronous response. Async tasks always return a persisted URL. |
background | string | No | auto, opaque, transparent | Background mode; model-dependent. |
output_format | string | No | png, jpeg, webp | Output file format; model-dependent. |
output_compression | integer | No | Usually 0 to 100 | JPEG/WebP compression quality; model-dependent. |
style | string | No | Common: vivid, natural | Style option; model-dependent. |
moderation | string | No | Common: auto, low | Moderation level; model-dependent. |
stream | boolean | No | true, false | Requests a streamed synchronous response. Async tasks require false or omission. |
image, image[] | file | For multipart editing | PNG, JPEG, WebP; async tasks allow at most 10 images, with a per-file limit of 10 MB | Reference image. Use image[] for multiple images. Async multipart files are persisted before worker execution. |
images | object array | For async JSON editing | At most 10 items | Every item must contain only image_url. |
mask | file or model-supported JSON URL/value | No | Usually PNG | Edit mask; model-dependent. |
input_fidelity | string | No | Common: low, high | Reference-image fidelity; model-dependent. |
With curl -F, do not set Content-Type manually. Send scalar multipart values such as n and output_compression as text form fields.
OpenAI-compatible response
When R2 upload succeeds, a URL is returned:
{"created":1786192453,"data":[{"url":"https://file.lunadownload.com/temporary/2026/08/12/uuid.png"}]}If R2 is not configured or upload fails, the response contains b64_json instead:
{"created":1786192453,"data":[{"b64_json":"iVBORw0KGgo..."}]}| Field | Type | Description |
|---|---|---|
created | integer | Image creation timestamp returned by the provider. |
data | array | Image result list. |
data[].url | string | R2 or provider image URL. The URL may be periodically removed. |
data[].b64_json | string | Base64 image, normally present only for synchronous requests when R2 rewriting is unavailable. |
data[].revised_prompt | string | Provider-revised prompt; returned only by some models. |
Temporary image URLs
Images returned through file.lunadownload.com are temporary and periodically removed. Download and store generated files promptly.
Native Gemini generation
This interface is only for Gemini image models. gpt-image-2 does not support it.
curl "https://ai.silicogrove.com/v1beta/models/gemini-3.1-flash-image:generateContent" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role":"user","parts":[{"text":"Generate a 16:9 neon city in the rain at night"}]}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"imageConfig": {"aspectRatio":"16:9","imageSize":"2K"}
}
}'Native Gemini editing
Gemini has no separate native editing endpoint. Send the reference image as inlineData to the same generateContent endpoint.
IMAGE_B64=$(base64 < input.png | tr -d '\n')
curl "https://ai.silicogrove.com/v1beta/models/gemini-3.1-flash-image:generateContent" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"contents\":[{\"role\":\"user\",\"parts\":[
{\"text\":\"Keep the subject and change the background to a city at night\"},
{\"inlineData\":{\"mimeType\":\"image/png\",\"data\":\"${IMAGE_B64}\"}}
]}],
\"generationConfig\":{\"responseModalities\":[\"TEXT\",\"IMAGE\"],\"imageConfig\":{\"aspectRatio\":\"1:1\",\"imageSize\":\"2K\"}}
}"When R2 upload succeeds, generated media appears as fileData.fileUri; otherwise Gemini returns the original inlineData base64 payload.
Parameter mapping for Gemini models
| OpenAI image parameter | Native Gemini field |
|---|---|
prompt | contents[].parts[].text |
image file | contents[].parts[].inlineData |
size: 1024x1024 | aspectRatio: 1:1 |
size: 1792x1024 | aspectRatio: 16:9 |
size: 1024x1792 | aspectRatio: 9:16 |
size: 1536x1024 | aspectRatio: 3:2 |
size: 1024x1536 | aspectRatio: 2:3 |
quality: auto, fast, or 1k | imageSize: 1K |
quality: high, hd, or 2k | imageSize: 2K |
quality: 4k | imageSize: 4K |
Gemini image models currently generate one image per request: set n to 1.
Recommended integration
Prefer async image tasks. For clients requiring synchronous responses, use these OpenAI-compatible endpoints:
POST /v1/images/generations
POST /v1/images/editsUse POST /v1beta/models/{model}:generateContent only when you need the complete Gemini request format, multimodal contents, or the Gemini SDK.
Video
Video generation takes time; submit a task and poll its status to retrieve the finished video.
Video generation is asynchronous. Submit to POST /v1/videos, retain the returned task ID, then poll GET /v1/videos/{task_id} until the task reaches a terminal state. Video models must not be sent to /v1/chat/completions.
Available models depend on the API key and group. Call GET /v1/models before presenting model choices to end users.
Recommended model: Grok Video 1.5
| Model | Duration | Resolution |
|---|---|---|
grok-video-1.5 | 15 seconds by default; 6, 8, 10, 12, or 15 seconds when specified | Optional; 720p recommended |
grok-video-1.5 supports text-to-video, a single reference image, and multiple reference images (up to 7). The three examples below use the same endpoint; add image_urls when reference images are needed.
WARNING
When seconds is omitted, the request generates a 15-second video by default. When specified, seconds must be the string "6", "8", "10", "12", or "15". Sending "4" or any other value returns: seconds must be one of: 6, 8, 10, 12, 15.
Other supported Kling V3 models
| Model | Duration | Resolution | Billing |
|---|---|---|---|
kling-video-v3 | 3-15 seconds | 720p, 1080p, 4k | Per second and selected resolution |
kling-video-v3-omni | 3-15 seconds | 720p, 1080p, 4k | Per second and selected resolution |
kling-video-v3-turbo | 3-15 seconds | 720p, 1080p | Per second and selected resolution |
Send resolution as a top-level field in Kling create requests. Do not use the image-generation quality field for video resolution. The effective price is determined when the task is submitted, so do not rely on a fixed documented amount.
Grok Video 1.5 examples
Every example uses POST /v1/videos, Authorization: Bearer YOUR_API_KEY, and Content-Type: application/json.
1. Text to video
curl -X POST "https://ai.silicogrove.com/v1/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-video-1.5",
"prompt": "A cinematic sunrise over a futuristic coastal city, slow aerial camera movement",
"seconds": "15",
"aspect_ratio": "16:9",
"resolution": "720p"
}'2. One reference image
{
"model": "grok-video-1.5",
"prompt": "Rotate the product smoothly in soft studio lighting, as a clean premium commercial",
"seconds": "10",
"aspect_ratio": "9:16",
"resolution": "720p",
"image_urls": ["https://example.com/product.png"]
}3. Multiple reference images
{
"model": "grok-video-1.5",
"prompt": "Create a coherent product showcase using these references, with cinematic camera movement and premium commercial lighting",
"seconds": "15",
"aspect_ratio": "16:9",
"resolution": "720p",
"image_urls": [
"https://example.com/product-front.png",
"https://example.com/product-detail.png"
]
}The response includes a public id or task_id. Store that value; do not use an upstream task ID obtained from another API response.
{
"id": "task_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video",
"status": "queued"
}This example uses the recommended grok-video-1.5 model to create a 15-second text-to-video task. A successful create request returns an asynchronous task. Store task_id, then use Poll a task to retrieve progress and output.
{
"id": "task_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video.generation",
"model": "grok-video-1.5",
"status": "queued",
"progress": 0,
"created_at": 1786869597,
"result": {}
}Reference assets
Use public HTTPS URLs or complete data: URLs such as data:image/png;base64,.... Do not send a local file path or bare base64 bytes. Local files can be uploaded through Reference assets first.
image_urls is the preferred field. images is accepted for compatibility. Send only one of them. reference_images and input_reference: {"image_url":"..."} are also accepted for integrations that use those names; do not combine reference_images and input_reference in one request.
Request fields
| Field | Required | Description |
|---|---|---|
model | Yes | A video model available to the API key. |
prompt | Yes | Describe the subject, motion, camera, visual style, and composition. |
seconds | No | Requested duration as a string. When omitted, grok-video-1.5 defaults to 15 seconds. When specified, it accepts only "6", "8", "10", "12", or "15". |
aspect_ratio | No | 16:9, 9:16, or 1:1. |
resolution | Required for Kling V3; optional for Grok | 720p is recommended for Grok. Kling supports 480p, 720p, 1080p, or 4k, subject to the selected model. Send it as a top-level field; do not use quality as a replacement. |
image_urls | No | Preferred array of up to 7 reference image URLs or complete data URLs. |
images | No | Compatibility alias for image_urls; do not send both. |
image | No | grok-imagine-video-1.5 first-frame mode only. A single image URL or complete data URL. Do not combine with reference_images. |
reference_images | No | Compatibility array of reference images; do not combine with input_reference. |
input_reference | No | Compatibility single-image form: { "image_url": "https://..." }. |
The older video-ds-* models support images, videos, and audios. Their media limits are 4 images, 3 videos, and 1 audio file.
Poll a task
curl -X GET "https://ai.silicogrove.com/v1/videos/TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"Treat queued and in_progress as non-terminal. completed means the video is available; failed means generation ended unsuccessfully. Poll no more frequently than once every 5 seconds, and retain the task ID if a client-side timeout is reached.
Download the completed video
curl -L "https://ai.silicogrove.com/v1/videos/TASK_ID/content" \
-H "Authorization: Bearer YOUR_API_KEY" \
--output result.mp4The service may return a signed result URL internally. It is temporary and should be downloaded promptly. Use the content endpoint above rather than reconstructing an upstream URL, task ID, domain, or signature.
Security and reliability recommendations
API keys and callers
- Store API keys only in server-side environment variables or a secrets manager. Browsers, mobile apps, and public frontend code must not hold long-lived keys.
- Use separate API keys per application or purpose. A compromised key can then be revoked without interrupting unrelated workloads.
- After creating a task, persist both your local business identifier and the returned
task_idfor polling, reconciliation, and retry control.
Reference assets and downloads
- Reference URLs must be safely reachable by the video service. Do not provide private-network IP addresses, administrative endpoints, cloud credential URLs, or local file paths.
- After completion, download videos through the authenticated
/contentendpoint rather than exposing temporary result URLs long term. - Create a replacement task only after the existing task explicitly returns
failed. Continue polling the sametask_idwhile it isqueuedorin_progressto prevent duplicate generations and charges.
Grok Imagine models (currently unavailable)
WARNING
grok-imagine-video and grok-imagine-video-1.5 are currently unavailable and must not be used for production requests. This section is retained as a historical parameter reference; use the active Kling models above.
| Model | Generation modes | Duration | Resolution |
|---|---|---|---|
grok-imagine-video | Text to video | Model-dependent | Model-dependent |
grok-imagine-video-1.5 | Text to video, first-frame image to video, reference-image video | 4, 6, 8, 10, 12, or 15 seconds | Text and first-frame: 480p, 720p, 1080p; reference images: up to 720p |
grok-imagine-video-1.5 has two mutually exclusive image modes: first-frame mode accepts one image URL; reference-image mode accepts 1-7 reference_images URLs and uses <IMAGE_1>, <IMAGE_2>, and similar placeholders in the prompt. Do not send image, images, image_urls, or input_reference with reference_images. Reference-image mode is limited to 720p.
Historical request example:
{
"model": "grok-imagine-video-1.5",
"prompt": "The person from <IMAGE_1> walks through a city street in a cinematic commercial shot",
"reference_images": ["https://example.com/person.jpg"],
"seconds": "8",
"aspect_ratio": "16:9",
"resolution": "720p"
}Reference Assets
Upload local images, videos, or audio as temporary assets for subsequent generation requests.
Upload local images, videos, and audio to the temporary asset endpoint. The returned data.url can be placed in a video request's images, videos, or audios array.
Temporary files are periodically removed
Uploaded assets and generated results are temporary. Their URLs may expire during periodic cleanup. Download and store required files promptly; do not treat returned URLs as permanent storage.
# Image
curl -X POST "https://ai.silicogrove.com/pg/assets" -H "Authorization: Bearer YOUR_API_KEY" -F "kind=image" -F "file=@/path/to/ref.jpg"
# Video
curl -X POST "https://ai.silicogrove.com/pg/assets" -H "Authorization: Bearer YOUR_API_KEY" -F "kind=video" -F "file=@/path/to/ref.mp4"
# Audio
curl -X POST "https://ai.silicogrove.com/pg/assets" -H "Authorization: Bearer YOUR_API_KEY" -F "kind=audio" -F "file=@/path/to/ref.mp3"Response example
{"success":true,"data":{"kind":"image","url":"https://file.lunadownload.com/temporary/2026/08/11/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.jpg","filename":"ref.jpg","content_type":"image/jpeg","size":123456}}kind | Formats | Maximum file size |
|---|---|---|
image | jpg, png, webp | 10 MiB |
video | mp4, mov, webm | 100 MiB |
audio | mp3, m4a, wav, aac, ogg, webm | 20 MiB |
Audio
Use the audio APIs to turn text into speech or transcribe recordings into text.
Speech synthesis
curl -X POST "https://ai.silicogrove.com/v1/audio/speech" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_TTS_MODEL","input":"Welcome to Silico Grove API.","voice":"alloy","response_format":"mp3"}' \
--output speech.mp3Transcription and translation
curl -X POST "https://ai.silicogrove.com/v1/audio/transcriptions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=YOUR_STT_MODEL" \
-F "file=@/path/to/audio.mp3" \
-F "response_format=json"
curl -X POST "https://ai.silicogrove.com/v1/audio/translations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=YOUR_STT_MODEL" \
-F "file=@/path/to/audio.mp3" \
-F "response_format=json"Transcription and translation are multipart requests. The file field is file.
Troubleshooting
When a request fails, use its error symptoms to find the cause and corrective action.
| Symptom | Likely cause | Resolution |
|---|---|---|
| Model unavailable | The model and group do not match, or the key lacks permission. | Call /v1/models with the same key to confirm the model name. |
model is required | A relay renamed the field. | Preserve model; do not change it to model_name. |
| Video fails or enters a chat model | The request was sent to a chat endpoint. | Call POST /v1/videos. |
| Reference asset has no effect | A local path was sent, or the value was not an array. | Send public URLs in images, videos, or audios. |
Invalid seconds type | The duration was sent as a number. | Use a string, such as "seconds": "15". |
| Upload fails | Wrong content type or file field name. | Use -F and name the file field file. |
When reporting an issue, include request time, model, endpoint, group, request ID, and the error response. Do not share API keys, authorization headers, or sensitive prompts.
Relay Integrations
When connecting through another gateway, configure the upstream address and preserve request fields as described below.
- Use
https://ai.silicogrove.comorhttps://ai.silicogrove.com/v1as the primary upstream, depending on whether your relay adds/v1automatically. - The backup upstream is
https://api.silicogrove.comorhttps://api.silicogrove.com/v1; configure failover in the relay. - Synchronize
/v1/modelswith a Silico Grove API key rather than entering unavailable models manually. - Video models must stay on
/v1/videos; do not add them to a chat model pool. - Preserve the
images,videos, andaudiosarrays when forwarding video requests. - Image editing and audio transcription are multipart requests; do not lose their file fields during forwarding.
- Submit asynchronous images to
POST /v1/images/tasksand pollGET /v1/images/tasks/{task_id}; do not wrap an asynchronous task as a synchronous image response.
