Skip to content
GatewayOpenAPI

Run image.generate

POST/api/gateway/v1/generations/images

The endpoint fixes the business capability. Direct execution returns a completed result (200); durable execution returns a host-owned task receipt (202). Backend selection belongs to engine.prepare, never the caller or operation descriptor. A bare Core instance rejects durable plans before submission. Cloud routing: model identifies a route returned by GET /models; x-sine-route-id overrides route selection. Check the route's operations and billing_mode first. JSON bodies are limited to 1 MiB; supported multipart uploads are limited to 32 MiB, 128 fields and 65,536 characters per text field. Managed text-token pricing supports chat.completions only; other managed operations require an explicit operation price. Media execution requires a single target with automatic retry/fallback disabled. Idempotency-Key is optional and scoped to this organization and API key identity. Repeating an admitted key returns HTTP 409, never a cached success response or a replay of the provider call. invocationAlreadyExists means the stored input matches; idempotencyConflict means the key was used for different input. Preserve the same project, route and request when recovering. Capture x-sine-invocation-id; if x-sine-task-id or task is returned, retrieve the existing task. Otherwise inspect the invocation in the Console. A timeout, disconnected stream, unknown or expired task is not proof of failure; do not issue a new paid invocation until its outcome is resolved. Aborting HTTP does not cancel remote work.

Organization API key authentication

Authorization: Bearer $SINECLOUD_API_KEY

Required scopes: modelInvoke

Parameters

x-sine-project-id · header · Optional
Select an organization project. A project-restricted key defaults to its bound project and cannot select another project. The projectId query parameter takes precedence.
projectId · query · Optional
Optional project selection; takes precedence over x-sine-project-id and must respect the key restriction.
x-sine-route-id · header · Optional
Optional Cloud route override; otherwise the request model selects the route. Use a route visible to this key.
Idempotency-Key · header · Optional
Use a stable key for one intended invocation. Reuse returns 409 and does not replay or return a cached success. Without a key, each request can admit new paid work.

Request body

Required

A JSON object is required; arrays, primitives and malformed JSON are rejected.

application/json

Responses

200
Successful response. Provider-specific fields may be present.
202
Accepted durable task. Retrieve the task to observe its lifecycle and assets.
400
Invalid request, project identifier, unsupported model parameters or operation configuration.
401
Missing, expired, revoked or invalid organization Bearer API key.
402
Organization billing, managed budget or available credits do not permit a new invocation.
403
The key scope, project restriction, route policy, current membership or product entitlement denies access.
404
The project, route or authorized task was not found.
409
invocationAlreadyExists, idempotencyConflict, or managedModelChanged. Recover the original invocation/task; reload model configuration for managedModelChanged.
413
Body exceeds the Cloud limit: 1 MiB JSON or 32 MiB multipart.
415
Use the request media type documented for this operation.
429
Rate or concurrency limit reached. Honor Retry-After when returned.
500
Sanitized Cloud or Gateway failure.
502
Sanitized upstream failure or invalid native media response.
503
Gateway or durable task execution is unavailable. Restore the required service before continuing.
default
Other provider/host status. Provider errors below 500 may retain native shapes; internal/upstream errors at 500 or above are sanitized by the gateway.

Loading API reference…

Gateway · Setup & authentication

Base URLhttps://sinecloud.dev/api/gateway/v1

Before your first request

Select your organization, prepare resources in Console, and issue an organization API key with the required product scopes. Current permissions, resource access, budget and available funds are checked on every call.

Choose an available route from the model catalog and use its ID as model. The catalog covers model discovery, chat completions, responses, messages, embeddings, images, audio, generation and durable task lifecycle. Use the appropriate native protocol and preserve JSON, streaming SSE, multipart and binary body formats. Review current model access, supported operations and billing in Console.

Grant modelRead to list routes and modelInvoke for inference and task operations. Project restrictions and route policies apply on every request. Managed routes require available funds and budget; own-key routes use the organization’s provider credentials. Keep original task IDs and inspect durable status before retrying uncertain execution.

Organization key authentication and base URL

The production API origin is https://sinecloud.dev; the documentation origin does not serve product requests. The path prefix is /api/gateway/v1. Use the complete path documented for the operation, replacing resource IDs, models and endpoint revisions with your actual selections.

Authorization: Bearer $SINECLOUD_API_KEY

Set SINECLOUD_API_KEY to your own environment variable value; never use platform service credentials. Each operation lists required scopes in x-sinecloud-scopes.

This reference is read-only. Run requests in Console or your own client. Browsing documentation never creates a key, starts execution or incurs an execution charge. Keep request IDs and execution receipts; a lost connection does not cancel work. Follow the operation’s recovery instructions before submitting again.

Console

Type to search…

↑↓ navigate↵ selectEsc Close