Every API here is available over the APIs.io API and to AI agents over MCP.
{
"openapi": "3.1.0",
"info": {
"title": "CloudGPU API",
"version": "1.7.0",
"summary": "OpenAI-compatible model API and per-minute GPU rental, on one API key and one prepaid USD balance.",
"description": "CloudGPU (cloudgpu.app) offers two things behind one API key:\n\n1. **Model API**: an OpenAI-compatible endpoint (`/v1/chat/completions`, `/v1/images/generations`, `/v1/audio/*`) and the Claude Messages format (`/v1/messages`). Use any OpenAI SDK with `base_url = https://cloudgpu.app/v1`. `GET /v1/models` lists the models and needs no key.\n2. **GPU instances**: rent a GPU under source-specific minute or started-hour billing (`/v1/gpu/*`), with optional auto-shutdown limits (`max_minutes`, `max_spend_usd`, `idle_minutes`) that CloudGPU's servers enforce even after your client disconnects.\n3. **Agent compute discovery (no key needed)**: `GET /v1/public/gpu-catalog` lists GPU models, VRAM, live prices, billing rules and disk options; `POST /v1/quotes` estimates the cost of a task from VRAM, GPU count, template, disk size, duration and budget. Neither creates paid resources.\n\nAuthentication: `Authorization: Bearer <api key>` (keys start with `cgw-sk-`, created at https://cloudgpu.app/api). `x-api-key` is also accepted for Claude clients.\nBilling: prepaid USD balance; top up at https://cloudgpu.app/billing. When the balance runs out, running GPU instances are destroyed and their disks erased.\nErrors always look like `{\"error\": {\"type\", \"code\", \"message\"}}`.\nFor AI coding assistants there is an MCP server: `npx -y cloudgpu-mcp` (https://cloudgpu.app/docs/mcp).\n\nPersistent storage and Workspace endpoints are optional and return 503 until explicitly enabled. Check GET /v1/public/compute-capabilities. Full-disk restore and automatic output collection are not supported by this version.",
"contact": {
"name": "CloudGPU support",
"email": "support@cloudgpu.app",
"url": "https://cloudgpu.app/contact"
},
"termsOfService": "https://cloudgpu.app/terms"
},
"externalDocs": {
"description": "API documentation",
"url": "https://cloudgpu.app/api/docs"
},
"servers": [
{
"url": "https://cloudgpu.app",
"description": "Production"
}
],
"security": [
{
"bearer": []
}
],
"tags": [
{
"name": "Models",
"description": "OpenAI-compatible and Claude-compatible model API"
},
{
"name": "GPU",
"description": "Rent GPUs under source-specific minute or started-hour quotes"
},
{
"name": "Agent Compute",
"description": "Discover GPUs and get task quotes without an API key. Read-only; nothing here creates paid resources."
}
],
"paths": {
"/v1/models": {
"get": {
"tags": [
"Models"
],
"operationId": "listModels",
"summary": "List models",
"description": "Every model you can call, with per-token prices in USD per 1M tokens where they apply. No API key needed.",
"security": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"const": "list"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Model"
}
}
}
}
}
}
}
}
}
},
"/v1/chat/completions": {
"post": {
"tags": [
"Models"
],
"operationId": "createChatCompletion",
"summary": "Create a chat completion",
"description": "OpenAI Chat Completions format, including streaming (`stream: true`), tools / function calling and JSON mode where the model supports them. Billed per token at the rates in GET /v1/models.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"messages"
],
"properties": {
"model": {
"type": "string",
"description": "A model id from GET /v1/models"
},
"messages": {
"type": "array",
"description": "Conversation so far, OpenAI message format",
"items": {
"type": "object",
"properties": {
"role": {
"enum": [
"system",
"user",
"assistant",
"tool"
]
},
"content": {}
}
}
},
"stream": {
"type": "boolean",
"description": "Stream the response as server-sent events"
},
"max_tokens": {
"type": "integer",
"description": "Upper bound on generated tokens"
},
"temperature": {
"type": "number"
},
"tools": {
"type": "array",
"description": "Function definitions the model may call",
"items": {
"type": "object"
}
}
}
},
"example": {
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Say hi"
}
]
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "OpenAI chat.completion object (or an SSE stream of chat.completion.chunk when stream is true)"
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
},
"429": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/messages": {
"post": {
"tags": [
"Models"
],
"operationId": "createMessage",
"summary": "Create a message (Claude format)",
"description": "Claude Messages API format, for Claude Code and the anthropic SDKs. Point ANTHROPIC_BASE_URL at https://cloudgpu.app and use your CloudGPU key.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"messages",
"max_tokens"
],
"properties": {
"model": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object"
}
},
"max_tokens": {
"type": "integer"
},
"stream": {
"type": "boolean"
},
"system": {}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/messages/count_tokens": {
"post": {
"tags": [
"Models"
],
"operationId": "countTokens",
"summary": "Count tokens (Claude format)",
"description": "Token count for a Messages request, without running it.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/images/generations": {
"post": {
"tags": [
"Models"
],
"operationId": "createImage",
"summary": "Generate an image",
"description": "OpenAI Images format. Image size is capped at about 1 megapixel. Billed per image.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"prompt"
],
"properties": {
"model": {
"type": "string",
"description": "An image model id from GET /v1/models"
},
"prompt": {
"type": "string"
},
"size": {
"type": "string",
"example": "1024x1024"
},
"n": {
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/audio/speech": {
"post": {
"tags": [
"Models"
],
"operationId": "createSpeech",
"summary": "Text to speech",
"description": "OpenAI audio/speech format; returns audio bytes. Billed per character.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"input"
],
"properties": {
"model": {
"type": "string"
},
"input": {
"type": "string"
},
"voice": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Audio",
"content": {
"audio/mpeg": {}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/audio/transcriptions": {
"post": {
"tags": [
"Models"
],
"operationId": "createTranscription",
"summary": "Speech to text",
"description": "OpenAI audio/transcriptions format (multipart upload). Billed per second of audio.",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"required": [
"model",
"file"
],
"properties": {
"model": {
"type": "string"
},
"file": {
"type": "string",
"format": "binary"
},
"language": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/account": {
"get": {
"tags": [
"GPU"
],
"operationId": "getGpuAccount",
"summary": "Account balance and limits",
"description": "Balance in USD, how many instances this account may run at once (depends on its top-up history), and how many are running now. Check it before renting.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Account"
}
}
}
},
"401": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/offers": {
"get": {
"tags": [
"GPU"
],
"operationId": "listGpuOffers",
"summary": "GPUs for rent",
"description": "Every GPU model on sale with VRAM, the live price per GPU-hour (billing period and minimum charge depend on the quoted source) and availability. Prices and availability change during the day; read them right before renting.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"object",
"data"
],
"properties": {
"object": {
"const": "list"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Offer"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/templates": {
"get": {
"tags": [
"GPU"
],
"operationId": "listGpuTemplates",
"summary": "Instance templates",
"description": "Ready-made images (JupyterLab, Ollama, ComfyUI / FLUX, LLaMA-Factory and others) with the GPU each recommends. Templates with has_api_endpoint get a public HTTPS api_url.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"object",
"data"
],
"properties": {
"object": {
"const": "list"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Template"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/instances": {
"get": {
"tags": [
"GPU"
],
"operationId": "listGpuInstances",
"summary": "List instances",
"description": "Running and starting instances, plus those stopped in the last 7 days.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"object",
"data"
],
"properties": {
"object": {
"const": "list"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Instance"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Error"
}
}
},
"post": {
"tags": [
"GPU"
],
"operationId": "createGpuInstance",
"summary": "Rent a GPU",
"description": "Starts an instance and returns at once with status `creating`. Poll GET /v1/gpu/instances/{id} until it is `running`. Nothing is charged if it ends up `failed`. Give gpu_model, template, or both.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"gpu_model": {
"type": "string",
"description": "GPU model exactly as GET /v1/gpu/offers lists it. Use \"auto\" (or omit it together with a template) to let us pick an available GPU that can run the request, choosing by price; if the GPU you name cannot run the template, the error lists GPUs that can, with current prices."
},
"template": {
"type": "string",
"description": "Template id from GET /v1/gpu/templates; omit for a plain GPU with Python and CUDA"
},
"gpu_count": {
"type": "integer",
"minimum": 1,
"maximum": 8,
"description": "Number of GPUs (at least the offer's min_gpu_count)"
},
"max_minutes": {
"type": "integer",
"minimum": 1,
"maximum": 10080,
"description": "Destroy the instance this many minutes after it starts (enforced server-side)"
},
"max_spend_usd": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Destroy the instance before it would cost more than this (enforced server-side)"
},
"idle_minutes": {
"type": "integer",
"description": "Destroy after the GPU has been idle this long; 10–1440, 0 = off (enforced server-side). Package installs and downloads count as idle."
},
"setup_script": {
"type": "string",
"maxLength": 16384,
"description": "Optional bash script run once as root in the background after the instance is handed over. Saved at /root/cloudgpu-setup.sh; output in /root/cloudgpu-setup.log. Up to 16 KB."
},
"quote_id": {
"type": "string",
"description": "Optional id from POST /v1/quotes. gpu_count, template and disk_gb left out are taken from the quote; ones you send must match it. Fails with 409 and starts nothing: quote_expired (request a new quote), gpu_unavailable (choose another GPU), price_changed (re-quote and check the budget), quote_mismatch (fix the configuration). Insufficient balance returns 402 insufficient_balance."
}
}
},
"example": {
"gpu_model": "RTX 4090",
"max_minutes": 120,
"max_spend_usd": 2,
"idle_minutes": 30
}
}
}
},
"responses": {
"202": {
"description": "Accepted; status is creating",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Instance"
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"401": {
"$ref": "#/components/responses/Error"
},
"402": {
"$ref": "#/components/responses/Error"
},
"429": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/instances/{id}": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Instance id returned by POST /v1/gpu/instances",
"schema": {
"type": "string"
}
}
],
"get": {
"tags": [
"GPU"
],
"operationId": "getGpuInstance",
"summary": "Get an instance",
"description": "Status, cost so far, SSH login once running, the public api_url for API templates, and the auto-shutdown limits.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Instance"
}
}
}
},
"404": {
"$ref": "#/components/responses/Error"
}
}
},
"delete": {
"tags": [
"GPU"
],
"operationId": "destroyGpuInstance",
"summary": "Destroy an instance",
"description": "Stops billing and erases the instance's disk. Download results first. Billing is per minute, and unused prepaid time is refunded to the balance.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Instance"
}
}
}
},
"404": {
"$ref": "#/components/responses/Error"
},
"409": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/gpu/instances/{id}/destroy": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Instance id returned by POST /v1/gpu/instances",
"schema": {
"type": "string"
}
}
],
"post": {
"tags": [
"GPU"
],
"operationId": "destroyGpuInstancePost",
"summary": "Destroy an instance (POST)",
"description": "Same as DELETE /v1/gpu/instances/{id}, for clients that cannot send DELETE.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Instance"
}
}
}
},
"404": {
"$ref": "#/components/responses/Error"
},
"409": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/public/gpu-catalog": {
"get": {
"tags": [
"Agent Compute"
],
"operationId": "getGpuCatalog",
"security": [],
"summary": "Public GPU catalog (no key)",
"description": "Discover GPU compute offerings on CloudGPU: GPU model, VRAM, live price per GPU-hour, availability (available / limited / unavailable), billing rules (per minute, 1-minute minimum, one hour pre-authorised), system disk options with their hourly add-on, ready templates and features. Read-only: this does not create paid resources. Cache for `cache_ttl_seconds`.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"object": {
"const": "gpu.catalog"
},
"schema_version": {
"type": "string"
},
"currency": {
"const": "USD"
},
"pricing_unit": {
"const": "gpu_hour"
},
"generated_at": {
"type": "string",
"format": "date-time"
},
"cache_ttl_seconds": {
"type": "integer"
},
"billing": {
"type": "object"
},
"disk_options": {
"type": "array",
"items": {
"type": "object"
}
},
"features": {
"type": "array",
"items": {
"type": "string"
}
},
"templates": {
"type": "array",
"items": {
"type": "object"
}
},
"gpus": {
"type": "array",
"items": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"vram_gb": {
"type": [
"integer",
"null"
]
},
"price_per_gpu_hour_usd": {
"type": "number"
},
"min_gpu_count": {
"type": "integer"
},
"availability": {
"enum": [
"available",
"limited",
"unavailable"
]
},
"tier": {
"type": "string"
}
}
}
}
}
}
}
}
},
"429": {
"description": "Rate limited"
}
}
}
},
"/v1/quotes": {
"post": {
"tags": [
"Agent Compute"
],
"operationId": "createQuote",
"security": [],
"summary": "Quote a GPU task (no key)",
"description": "Estimate what a task would cost. Filters GPUs by VRAM, GPU count, template and system disk, then returns candidates sorted by estimated total cost, each with its hourly price, billed minutes, estimated total and the balance needed to start. The quote expires after 5 minutes and is an estimate: price, stock and balance are checked again when you start an instance, and a changed price returns an error rather than a dearer GPU. This does not create paid resources. Send an API key to also learn whether your balance can start each candidate (can_start_with_balance).",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"requirements": {
"type": "object",
"properties": {
"min_vram_gb": {
"type": "integer"
},
"gpu_count": {
"type": "integer",
"default": 1
},
"gpu_model": {
"type": "string"
},
"template": {
"type": "string"
},
"disk_gb": {
"enum": [
0,
100,
200,
500
]
}
}
},
"estimated_duration_seconds": {
"type": "integer",
"default": 3600
},
"max_budget_usd": {
"type": "string"
},
"sort_by": {
"enum": [
"estimated_total_cost",
"vram"
]
}
}
},
"example": {
"requirements": {
"min_vram_gb": 24,
"gpu_count": 1
},
"estimated_duration_seconds": 1800,
"max_budget_usd": "1.00"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Quote"
}
}
}
},
"400": {
"$ref": "#/components/responses/Error"
},
"429": {
"description": "Rate limited"
}
}
}
},
"/v1/quotes/{id}": {
"get": {
"tags": [
"Agent Compute"
],
"operationId": "getQuote",
"security": [],
"summary": "Read a quote (no key)",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Quote"
}
}
}
},
"404": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v1/jobs": {
"post": {
"tags": [
"Jobs
# --- truncated at 32 KB (98 KB total) ---
# Full source: https://artifacts.apis.io/cloudgpu-app/openapi/_original/cloudgpu-app-api-openapi.json