API Reference

API Reference

URL: /docs/api-reference/

The API Reference provides the technical information required to integrate InstantGPU services into your applications.

Authentication #

Authenticate requests using your InstantGPU API key in the Authorization header:

Authorization Header
Authorization: Bearer YOUR_API_KEY

API Request #

A typical API request includes:

Endpoint URL

Target model HTTPS gateway URL.

HTTP Method

POST for inference / GET for status.

Authentication

Bearer YOUR_API_KEY header.

Content Type

application/json

Request Parameters

JSON payload containing model input, hyperparameters, and options.

Request Example

curl -X POST "https://api.instantgpu.ai/v1/endpoints/image-generation/runsync" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Generate an image of a futuristic city",
    "width": 1024,
    "height": 1024,
    "num_outputs": 1
  }'

Request Parameters #

Parameters depend on the selected endpoint or model. Common parameters include:

Prompt / Input Text

The core instruction or content string supplied to the model.

Image Dimensions

Width and height dimensions for visual models (e.g. 512x512, 1024x1024).

Number of Outputs

How many sample completions, variations, or images to return.

Model Settings & Hyperparameters

Temperature, top_p, max_tokens, guidance_scale, seed, and inference steps.

Response #

The API returns a structured JSON payload with the output generated by the selected service:

Response JSON (HTTP 200 OK)
{
  "id": "req_01jf8b9a2x3y4z",
  "status": "COMPLETED",
  "executionTimeMs": 842,
  "output": {
    "images": [
      "https://storage.instantgpu.ai/outputs/futuristic-city.png"
    ]
  }
}

Error Handling #

Applications should handle common HTTP status codes and error bodies gracefully:

401 Unauthorized

Invalid or missing InstantGPU API key. Verify Bearer token.

400 Invalid Request

Missing required parameters or malformed JSON payload.

404 Not Found

Endpoint unavailable or wrong URL path.

429 Rate Limit

Request volume exceeded quota. Back off and retry.

504 Timeout

Execution exceeded maximum worker timeout threshold.

500 Server Error

Internal worker exception. Review runtime logs in dashboard.

Rate Limits #

Rate limits may vary depending on the service, endpoint tier, and account configuration. Applications should handle rate-limit responses gracefully by respecting the Retry-After response header and implementing exponential backoff.

View Available AI Endpoints → Serverless GPU Docs →
Ask about InstantGPU...
Ctrl I