Skip to main content

Introduction

This API reference describes the RESTful, streaming, and realtime APIs you can use to interact with GMI Inference. REST APIs are usable via HTTP in any environment that supports HTTP requests.

Authentication

The GMI API uses API keys for authentication. Create, manage, and learn more about API keys in your organization settings. Important Security Notes:
  • API keys should be provided via HTTP Bearer authentication:
    Authorization: Bearer GMI_API_KEY
    
  • Never expose API keys in client-side code
  • Load keys from environment variables or key management services
  • For multi-organization access, specify headers:
    # Set API key as an environment variable
    export GMI_API_KEY=<your-api-key>
    export GMI_ORG_ID=<your-org-id>
    # Call API
    curl https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models \
      -H "Authorization: Bearer $GMI_API_KEY" \
      -H "X-Organization-ID: $GMI_ORG_ID"
    

List Video Models

GET https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models Lists available models by model_id.

Example Request

curl https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models \
  -H "Authorization: Bearer $GMI_API_KEY"

Response

{
  "model_ids": [
    "Kling-Image2Video-V2.1-Master",
    "Kling-Text2Video-V2.1-Master",
    "Luma-Ray2",
    "Veo3",
    "Veo3-Fast",
    // ... other models ...
  ]
}

Show Model Details

GET https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models/{model-id} Retrieves details for {model_id}. Use this to get full details of the model’s schema and parameters.

Example Request

curl https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/models/Veo3 \
  -H "Authorization: Bearer $GMI_API_KEY"

Response

{
  "model": "Veo3",
  "org_id": "google",
  "brief_description": "Google Veo 3 - State-of-the-art video generation model that creates high-quality videos from text prompts and images.",
  "detailed_description": "# Veo3 API Usage Guide\n\n## Overview\n\n**Veo3** is Google's most advanced video generation model, capable of creating stunning, realistic videos from text descriptions and optional reference images...",
  "modalities": {
    <dict>
  },
  "parameters": [
    {
      "name": "prompt",
      "display_name": "Text Prompt",
      "description": "The text prompt used to guide video generation.",
      "type": "string",
      "required": true,
    },
    // other parameters
  ]
  // other details
}

Create Requests

POST https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests The service API handles the full request/response cycle. It accepts the job, publishes status information, and publishes a link to the resulting artifact once processing completes. Clients can enqueue jobs and retrieve details and status. At the end of a successful job, the client can find the artifact details in the final status report.

Example Request

All jobs are processed asyncronously. A successful request will be accepted and enqueued. The server will respond with request details.
# Send a request to enqueue a video job. Capture the details to the variable response.
response=$(curl --request POST \
  --url "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests" \
  --header "Authorization: Bearer $GMI_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "Veo3",
  "payload": {
    "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
    "durationSeconds": "8",
    "aspectRatio": "16:9",
    "negativePrompt": "blurry, low quality, distorted",
    "personGeneration": "allow_adult",
    "seed": null
  }
}')

Response

echo $response | jq .
{
  "request_id": "5a7a5466-7948-47d8-8578-cff4b9581feb",
  "model": "Veo3",
  "status": "dispatched",
  "created_at": 1753427199,
  "updated_at": 1753427199,
  "queued_at": 1753427199
}

Observe Requests

GET https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/$REQUEST_ID Clients should use the Requests API to find out when a job is complete and retrieve artifact details. The status field indicates if the job is dispatched, processing, finished, or other condition.

Example Request

# Get request_id
REQUEST_ID=$(echo $response | jq -r .request_id)
# Send request
curl --request GET \
  --url https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/$REQUEST_ID \
  --header "Authorization: Bearer $GMI_API_KEY"

Response

{
  "request_id": "6fb2b474-fb3a-480f-a142-f200537c6de4",
  "org_id": "63729242-1870-4ff4-80b0-d485980ae31c",
  "model": "Veo3",
  "status": "processing",
  "is_public": false,
  "payload": {
    "aspectRatio": "16:9",
    "durationSeconds": "8",
    "negativePrompt": "blurry, low quality, distorted",
    "personGeneration": "allow_adult",
    "prompt": "A majestic eagle soaring through a mountain landscape at sunset",
    "seed": null
  },
  "outcome": null,
  "created_at": 1753468514,
  "updated_at": 1753468514,
  "queued_at": 1753468514
}

Monitor a Request

This script will poll the job queue and block until the job is complete.
until [ ${video_gen_status:-"Initializing"} == "success" ]
do 
  video_gen_status=$(curl --silent --request GET \
  --url https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/$REQUEST_ID \
  --header "Authorization: Bearer $GMI_API_KEY" | jq --raw-output .status)
  echo $video_gen_status
  sleep 1
done
unset video_gen_status

Fetch the completed artifacts

A successful job will create a dict of output artifacts. Follow the links to retrieve result files.

Example Request

curl --request GET --silent --url https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/requests/$REQUEST_ID \
  --header "Authorization: Bearer $GMI_API_KEY" | jq .outcome

Response

{
  "thumbnail_image_url": "https://storage.googleapis.com/gmi-video-assests-prod/user-assests/63729242-1870-4ff4-80b0-d485980ae31c/15809070173546291047/sample_0.mp4",
  "video_url": "https://storage.googleapis.com/gmi-video-assests-prod/user-assests/63729242-1870-4ff4-80b0-d485980ae31c/15809070173546291047/sample_0.mp4"
}

File Handling

Some endpoints accept file URLs or Base64 data URIs.
MethodNotes
Data URIConvenient for small files. Large payloads may slow requests.
Hosted URLMust be publicly accessible; some hosts block cross-site or rate-limit.
Upload APIUpload a file to GMI and get back a stable public URL to reuse in requests — see Upload API below.
Check each model’s discription for details.

Upload API

If you’d rather not host files yourself, GMI provides a two-step upload that returns a stable public URL. Pass that URL to any endpoint that accepts an image, video, or audio input — for example Kling’s image_list / video_list / element_list (frontal_image, refer_images, refer_videos) or Seedance’s reference_images / reference_videos. 1. Request an upload URL
curl -X POST "https://console.gmicloud.ai/api/v1/ie/requestqueue/apikey/upload-url" \
  -H "Authorization: Bearer $GMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_type": "png"}'
file_type is the file extension. Allowed values: jpeg, jpg, png, mp4, mp3, wav. Response:
{
  "upload_url": "https://storage.googleapis.com/.../<id>.png?X-Goog-Algorithm=...",
  "public_url": "https://storage.googleapis.com/.../<id>.png"
}
FieldDescription
upload_urlPre-signed URL to upload the file to. Valid for ~15 minutes.
public_urlStable, publicly accessible URL to reference in later requests.
2. Upload the file PUT the raw bytes to upload_url, with Content-Type matching the file type (image/png, image/jpeg, video/mp4, audio/mpeg, audio/wav).
curl -X PUT "<upload_url>" \
  -H "Content-Type: image/png" \
  --data-binary @./character.png
3. Reference the file Use public_url wherever a hosted URL is accepted:
"image_list": [
  { "image_url": "<public_url>", "type": "first_frame" }
]