Agent Integration
Discover capabilities, choose models, and execute ThankYou generations from agents via REST API, Response API, or Skill CLI
ThankYou is designed so agents can discover what is available, choose the right model or model/task selector, and call a single generation endpoint.
There are three ways to integrate ThankYou into your agent:
| Method | Best for | Latency | Setup |
|---|---|---|---|
| REST API | Any HTTP-capable agent | Sync or async | API key |
| Response API | OpenAI-compatible agents (GPT, Claude via adapter) | Streaming | API key + tool schema |
| Skill CLI | Claude Code, local dev agents, CI pipelines | Sync | npx / global install |
REST API
The core integration path. Three steps: discover → choose → generate.
Step 1: Discover capabilities
Capabilities are task-level discovery. They answer: what can this API do right now?
curl https://api.thankyouai.com/open/v1/capabilities \
-H "Authorization: Bearer $THANKYOU_API_KEY"Example response
{
"capabilities": [
{
"id": "image",
"name": "Image Generation",
"status": "available",
"description": "Generate or edit images through the unified generation API.",
"recommended_models": [
"google/nano-banana/pro/text-to-image",
"google/nano-banana/v2/edit"
],
"supports_wait": true,
"supports_webhook": true,
"supports_cancel": true,
"supports_status": true,
"supports_retry": true,
"input_schema_summary": {
"prompt": "string",
"negative_prompt": "string",
"reference_assets": "array",
"aspect_ratio": "string"
}
}
]
}Step 2: Discover models
Models are execution-level discovery. They answer: which engine or task suffix should actually run this request?
curl https://api.thankyouai.com/open/v1/models \
-H "Authorization: Bearer $THANKYOU_API_KEY"Example fields:
{
"models": [
{
"id": "bytedance/seedance/v2/text-to-video",
"display_name": "Seedance V2",
"operation": "text-to-video",
"supported_modes": ["image-to-video", "text-to-video"],
"providers": ["bytedance"]
}
]
}Step 3: Execute one generation call
Agents do not need separate per-capability endpoints. They call POST /open/v1/generate.
curl -X POST https://api.thankyouai.com/open/v1/generate \
-H "Authorization: Bearer $THANKYOU_API_KEY" \
-H "Prefer: wait=30" \
-H "Content-Type: application/json" \
-d '{
"model": "google/nano-banana/pro/text-to-image",
"input": {
"prompt": "A cat in space, digital art"
}
}'Converting capability discovery into tools
import requests
import anthropic
caps = requests.get(
"https://api.thankyouai.com/open/v1/capabilities",
headers={"Authorization": f"Bearer {THANKYOU_API_KEY}"},
).json()
tools = [
{
"name": f"thankyou_{cap['id']}",
"description": cap["description"],
"input_schema": {
"type": "object",
"properties": {
"model": {"type": "string"},
"input": {"type": "object"},
},
"required": ["model", "input"],
},
}
for cap in caps["capabilities"]
]
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
tools=tools,
messages=[{"role": "user", "content": "Generate a picture of a cat in space"}],
)import requests
import openai
caps = requests.get(
"https://api.thankyouai.com/open/v1/capabilities",
headers={"Authorization": f"Bearer {THANKYOU_API_KEY}"},
).json()
tools = [
{
"type": "function",
"function": {
"name": f"thankyou_{cap['id']}",
"description": cap["description"],
"parameters": {
"type": "object",
"properties": {
"model": {"type": "string"},
"input": {"type": "object"},
},
"required": ["model", "input"],
},
},
}
for cap in caps["capabilities"]
]
client = openai.OpenAI()
response = client.responses.create(
model="gpt-5.4",
tools=tools,
input="Generate a picture of a cat in space",
)Response API
For agents built on the OpenAI Response API (or any framework that speaks the same protocol), ThankYou exposes a compatible tool-calling endpoint. Your agent registers ThankYou capabilities as tools, and the model decides when to invoke them — no manual orchestration needed.
Register ThankYou as a tool
import anthropic
client = anthropic.Anthropic()
tools = [
{
"name": "thankyou_generate",
"description": "Generate images, videos, or audio via the ThankYou unified API.",
"input_schema": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "Model id, e.g. google/nano-banana/pro/text-to-image"
},
"input": {
"type": "object",
"description": "Generation parameters (text, references, aspect_ratio, etc.)"
}
},
"required": ["model", "input"]
}
}
]
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
tools=tools,
messages=[{"role": "user", "content": "Generate a watercolor painting of Tokyo at sunset"}],
)
# When the model calls thankyou_generate, forward to POST /open/v1/generateimport openai
client = openai.OpenAI()
tools = [
{
"type": "function",
"function": {
"name": "thankyou_generate",
"description": "Generate images, videos, or audio via the ThankYou unified API.",
"parameters": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "Model id, e.g. google/nano-banana/pro/text-to-image"
},
"input": {
"type": "object",
"description": "Generation parameters (text, references, aspect_ratio, etc.)"
}
},
"required": ["model", "input"]
}
}
}
]
response = client.responses.create(
model="gpt-5.4",
tools=tools,
input="Generate a watercolor painting of Tokyo at sunset",
)
# When the model calls thankyou_generate, forward to POST /open/v1/generateHandle tool calls
When the model returns a tool_use (Claude) or function_call (OpenAI) for thankyou_generate, forward the arguments directly to ThankYou:
import requests
def handle_thankyou_tool_call(arguments: dict) -> dict:
response = requests.post(
"https://api.thankyouai.com/open/v1/generate",
headers={
"Authorization": f"Bearer {THANKYOU_API_KEY}",
"Prefer": "wait=30",
},
json=arguments,
)
return response.json()The Response API path is ideal when your agent already speaks the OpenAI or Anthropic tool-calling protocol — ThankYou fits in as just another tool.
Skill CLI
For local development, CI pipelines, and agents like Claude Code, ThankYou provides a CLI that wraps the generation API into a single command.
Install
npm install -g @anthropic/thankyou-cliOr run directly without installing:
npx @anthropic/thankyou-cli generate --model google/nano-banana/pro/text-to-image --text "A cat in space"Usage
# Image generation
thankyou generate --model google/nano-banana/pro/text-to-image \
--text "A cat in space, digital art" \
--aspect-ratio 16:9 \
--output ./output.png
# Video generation
thankyou generate --model bytedance/seedance/v2/text-to-video \
--text "A timelapse of flowers blooming" \
--duration 5 \
--output ./output.mp4
# List available models
thankyou models
# List capabilities
thankyou capabilities
# Check generation status
thankyou status <generation-id>Configuration
Set your API key once:
thankyou auth login
# or via environment variable
export THANKYOU_API_KEY=your_key_hereAgent integration via CLI
Agents that can execute shell commands (Claude Code, Devin, Cursor, etc.) can use the CLI directly:
# The agent calls this as a tool / shell command
thankyou generate \
--model google/nano-banana/pro/text-to-image \
--text "A cat in space" \
--json # Returns structured JSON for the agent to parseExample JSON output:
{
"id": "gen_abc123",
"status": "succeeded",
"output": [
{
"url": "https://assets.thankyou.ai/gen/gen_abc123.png",
"mime_type": "image/png",
"width": 1024,
"height": 1024
}
]
}The Skill CLI is especially useful for Claude Code — agents can call thankyou generate as a bash tool and get structured output without managing HTTP requests.
Agent-friendly design principles
1. One create path
Agents only need to know one execution endpoint: POST /open/v1/generate.
2. Capabilities and models are separate on purpose
/capabilitiesgives task intent, rollout state, and lifecycle support./modelsgives execution engines, supported task suffixes, and routing metadata.
3. Flat common input
Fields like prompt, text, duration, and reference_assets stay flat under input. Use each model's input_schema for the exact field list.
4. Provider routing is optional
Most agents should ignore provider selection and let ThankYou optimize routing. Advanced agents can pass a provider object when cost, latency, or regulatory constraints matter.
5. Structured retryability
Errors expose retryable, so agents can tell the difference between transient provider issues and user-fixable input mistakes.
llms.txt
ThankYou can expose a machine-readable API description for agents:
# ThankYou API
> Unified media generation API for image, video, and audio
## Docs
- API Docs: https://docs.thankyou.ai/docs
- Capabilities Schema: https://api.thankyouai.com/open/v1/capabilities
- Models Catalog: https://api.thankyouai.com/open/v1/models
## Core Endpoints
- POST /open/v1/generate
- POST /open/v1/generate/quote
- GET /open/v1/generations/{id}
- GET /open/v1/generations/{id}/statusExample: full agent loop
import requests
API = "https://api.thankyouai.com/open/v1"
HEADERS = {"Authorization": f"Bearer {THANKYOU_API_KEY}"}
caps = requests.get(f"{API}/capabilities", headers=HEADERS).json()
image_cap = next(c for c in caps["capabilities"] if c["id"] == "image")
model = image_cap["recommended_models"][0]
generation = requests.post(
f"{API}/generate",
headers={**HEADERS, "Prefer": "wait=30"},
json={
"model": model,
"input": {
"text": "A cat in space, digital art"
},
},
).json()
print(generation["status"])