On this page

Built for AI agents

Human developers poll. Agents should not have to. Corent gives autonomous workflows three affordances that a synchronous request/response API does not: webhooks so a generation can run fully in the background, a streaming endpoint so progress arrives without repeated requests, and batch endpoints so up to 50 generations are one API call instead of 50 separate ones. Everything below works alongside the standard endpoints in the main docs. Nothing about authentication or pricing changes.

the agent loop

Plain language in. Finished media out.

your agent

“a 10-second vertical sunrise clip for TikTok, under 50¢”

CORENT

picks the model
reroutes on failure

delivered

corent-video-fast

9:16 · 10s · $0.44

01

Connect

Paste the MCP config or an API key — once. The key stays server-side.

02

Describe

Say the outcome in plain words, with a spend ceiling. No model, no tier.

03

Deliver

Corent routes to the best model, reroutes on failure, returns media + a receipt.

Connect to your AI assistant in one paste

Add the Corent MCP server
Give Claude, Cursor, or any MCP client the ability to generate images and video. Get an API key from your dashboard, then paste one of these. The key stays server-side — never in your app's browser code.

Hosted server (nothing to install)

Hosted (no install, Streamable HTTP):
https://mcp.corent.tech/mcp

Claude Code (one command)

claude mcp add corent \
  -e CORENT_API_KEY=co_live_... \
  -- npx -y corent-mcp

Claude Desktop / Cursor / any MCP client (config file)

{
  "mcpServers": {
    "corent": {
      "command": "npx",
      "args": ["-y", "corent-mcp"],
      "env": { "CORENT_API_KEY": "co_live_..." }
    }
  }
}
Then just describe what you want
The MCP exposes a plan tool (preview what Corent would do, no cost) and a create tool (describe it + a spend ceiling, Corent decides everything and generates). Your agent never picks a model or tier.
You: make me a vertical 10-second clip of a sunrise for TikTok

Agent → calls Corent "create" { intent: "...", max_cost_cents: 50 }
Corent decides: video, corent-video-fast, 9:16, 10s — and generates it.
No model names, no tiers, no parameters. The agent just described it.

Fire and forget with webhooks

Add webhook_url to any generate request and the call returns 202 Accepted immediately with a job id. Corent generates in the background and posts the full result to your URL when it is done. Add webhook_secret and every delivery is signed with an X-Corent-Signature header, an HMAC-SHA256 of the raw request body using your secret. Verify it before trusting the payload. Failed deliveries retry up to three times with exponential backoff.
curl -X POST https://api.corent.tech/v1/images/generate \
  -H "Authorization: Bearer co_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a matte black watch on a marble surface",
    "preference": "quality",
    "webhook_url": "https://your-server.com/webhooks/corent",
    "webhook_secret": "your_shared_secret"
  }'

# -> 202 Accepted
# { "id": "job_abc123", "status": "processing" }

# later, Corent POSTs to your webhook_url:
# { "id": "job_abc123", "status": "completed", "images": [...], "meta": {...} }

Track progress without polling

For video jobs, open a single connection to GET /v1/jobs/{id}/stream and Corent holds it open, pushing an event each time the job changes state: queued, processing (with an estimated progress_percent where available), completed, or failed. The connection closes on its own once the job reaches a terminal state. One connection replaces however many poll requests you would otherwise make.
curl -N https://api.corent.tech/v1/jobs/job_abc123/stream \
  -H "Authorization: Bearer co_live_..."

# event: processing
# data: {"id": "job_abc123", "status": "processing", "progress_percent": 42}
#
# event: completed
# data: {"id": "job_abc123", "status": "completed", "videos": [...], "meta": {...}}

Batch generation

Submit up to 50 items in a single call to /v1/images/generate/batch or /v1/videos/generate/batch. Corent processes up to 5 concurrently and returns a batch_id plus one job id per item immediately. Every item bills at the normal per-generation rate, there is no batch discount. If you set a webhook, each item delivers its own webhook as it finishes, tagged with the batch id so you can correlate them.
import requests

CORENT_API_KEY = "co_live_..."

items = [
    {"prompt": "a red sneaker on a white background", "preference": "fast"},
    {"prompt": "a blue sneaker on a white background", "preference": "fast"},
    {"prompt": "a green sneaker on a white background", "preference": "fast"},
    {"prompt": "a black sneaker on a white background", "preference": "fast"},
    {"prompt": "a yellow sneaker on a white background", "preference": "fast"},
]

res = requests.post(
    "https://api.corent.tech/v1/images/generate/batch",
    headers={"Authorization": f"Bearer {CORENT_API_KEY}"},
    json={
        "items": items,
        "webhook_url": "https://your-server.com/webhooks/corent",
        "webhook_secret": "your_shared_secret",
    },
)
res.raise_for_status()
batch = res.json()
print(batch["batch_id"], batch["job_ids"])

# check overall progress any time, no need to wait for every webhook
status = requests.get(
    f"https://api.corent.tech/v1/batches/{batch['batch_id']}",
    headers={"Authorization": f"Bearer {CORENT_API_KEY}"},
).json()
print(status["completed"], "of", status["total"], "done")

Function calling with Claude and OpenAI

Claude tool use
Pass these as the tools array in a Messages API call. When Claude returns a tool_use block, call the matching Corent endpoint with the given input and return the result as a tool_result.
{
  "tools": [
    {
      "name": "generate_image",
      "description": "Generate an image from a text prompt using Corent.",
      "input_schema": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string" },
          "preference": { "type": "string", "enum": ["fast", "cheap", "balanced", "quality"] },
          "aspect_ratio": { "type": "string" }
        },
        "required": ["prompt"]
      }
    },
    {
      "name": "generate_video",
      "description": "Generate a video from a text prompt using Corent.",
      "input_schema": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string" },
          "preference": { "type": "string", "enum": ["fast", "cheap", "balanced", "quality"] },
          "aspect_ratio": { "type": "string" },
          "duration_s": { "type": "integer" }
        },
        "required": ["prompt"]
      }
    }
  ]
}
OpenAI function calling
The same two capabilities as OpenAI function definitions, for the Chat Completions or Responses API.
{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "generate_image",
        "description": "Generate an image from a text prompt using Corent.",
        "parameters": {
          "type": "object",
          "properties": {
            "prompt": { "type": "string" },
            "preference": { "type": "string", "enum": ["fast", "cheap", "balanced", "quality"] },
            "aspect_ratio": { "type": "string" }
          },
          "required": ["prompt"]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "generate_video",
        "description": "Generate a video from a text prompt using Corent.",
        "parameters": {
          "type": "object",
          "properties": {
            "prompt": { "type": "string" },
            "preference": { "type": "string", "enum": ["fast", "cheap", "balanced", "quality"] },
            "aspect_ratio": { "type": "string" },
            "duration_s": { "type": "integer" }
          },
          "required": ["prompt"]
        }
      }
    }
  ]
}
LangChain tool wrapper
A minimal @tool wrapper around the two endpoints, ready to hand to any LangChain agent.
from langchain_core.tools import tool
import requests

CORENT_API_KEY = "co_live_..."

@tool
def generate_image(prompt: str, preference: str = "balanced") -> str:
    """Generate an image from a text prompt using Corent. Returns the image URL."""
    res = requests.post(
        "https://api.corent.tech/v1/images/generate",
        headers={"Authorization": f"Bearer {CORENT_API_KEY}"},
        json={"prompt": prompt, "preference": preference},
        timeout=30,
    )
    res.raise_for_status()
    return res.json()["images"][0]["url"]

@tool
def generate_video(prompt: str, preference: str = "balanced", duration_s: int = 5) -> str:
    """Start a video generation using Corent. Returns a job id to poll or stream."""
    res = requests.post(
        "https://api.corent.tech/v1/videos/generate",
        headers={"Authorization": f"Bearer {CORENT_API_KEY}"},
        json={"prompt": prompt, "preference": preference, "duration_s": duration_s},
        timeout=30,
    )
    res.raise_for_status()
    return res.json()["id"]

# tools = [generate_image, generate_video]
# agent = create_tool_calling_agent(llm, tools, prompt)

Recommended patterns

Idempotency
Send an Idempotency-Key header (any unique string) with every generate call. If the agent times out and retries with the same key, Corent returns the original job instead of generating and charging a second time — blind retries are safe by construction. No bookkeeping on your side needed.
Retry logic
Retry on 429 and 5xx only, never on 4xx validation errors, since those will fail again identically. Respect the Retry-After header on a 429 rather than guessing a backoff.
Cost caps per agent session
Give each agent, or each API key, its own daily cost cap in the dashboard rather than sharing one key across every agent you run. An agent that gets stuck in a loop then hits its own ceiling instead of draining the account.
Use the intent endpoint for autonomous workflows
If your agent is deciding what to generate on its own rather than following an explicit spec, send the raw natural language request straight to /v1/intent/execute instead of mapping it to a tier yourself. Corent picks the tier, aspect ratio, and quality for you, conservatively, so an agent cannot accidentally request the most expensive tier for a throwaway request. Pass confirm_estimated_cost_cents_up_to as a hard ceiling and Corent will return the plan and estimated cost without spending anything if it is exceeded.