How to Make Restory Agent-Friendly for Codex, Claude, ChatGPT, and MCP Workflows
Use Restory with Codex, Claude, ChatGPT, MCP tools, OpenAPI clients, markdown docs, CLI commands, and agent-readable media workflows.
Mark Tate
AI Video & Image Specialist
Share
How to Make Restory Agent-Friendly for Codex, Claude, ChatGPT, and MCP Workflows
Direct answer: Restory is agent-friendly because it exposes the same media workflow through public docs, markdown docs, capabilities JSON, OpenAPI JSON, a CLI, a SKILL.md file, API keys, queued jobs, polling endpoints, and stable result URLs.
That combination matters for AI agents. A coding agent wants markdown and commands. A custom tool runner wants OpenAPI. An MCP wrapper wants a small map of tool names to endpoints. A chat model wants a concise prompt and predictable JSON. Restory gives each of those systems a source it can read before taking action.
Agent-Readable Entry Points
| Agent type | Best Restory entry point | Why |
|---|---|---|
| Codex-style coding agent | Markdown docs and CLI | Fast context plus runnable commands |
| Claude project or desktop workflow | Markdown docs, SKILL.md, API examples | Concise instructions and safe operating rules |
| ChatGPT tool workflow | OpenAPI JSON and capabilities JSON | Schema-aware calls with current model settings |
| MCP server wrapper | OpenAPI plus tool map | Easy mapping to tools like generate_image and get_job |
| Shell-based automation | @restory/cli |
Local files, uploads, JSON output, polling |
The Minimum Context to Give an Agent
If you want an AI agent to use Restory correctly, give it these links:
- https://www.restory.pics/agent/docs
- https://www.restory.pics/api/agent/docs/markdown
- https://www.restory.pics/api/agent/capabilities
- https://www.restory.pics/api/agent/openapi
- https://www.restory.pics/agent for API key management
Those URLs tell the agent what Restory is, what it can generate, how to authenticate, which endpoints exist, and how to poll results.
Setup for Codex
For Codex or another coding agent with shell access, the cleanest path is the CLI plus the Restory skill instructions.
npm install -g @restory/cli
export RESTORY_API_KEY="rst_..."
restory capabilities
restory credits
Then give the agent a task like:
Use Restory for media generation. Read the agent docs and capabilities first. Use the RESTORY_API_KEY environment variable. Generate three ad images, poll jobs until completed, and return result URLs in a manifest. Do not print the API key.
Codex-style agents work well with the SKILL.md pattern because the file spells out behavior: discover first, check credits, submit jobs, poll completion, and return URLs.
Setup for Claude
For Claude, keep the context shorter and more declarative. Use the markdown docs as source context and ask Claude to preserve operating rules.
Use this source context:
https://www.restory.pics/api/agent/docs/markdown
https://www.restory.pics/api/agent/capabilities
https://www.restory.pics/api/agent/openapi
Rules:
- Use RESTORY_API_KEY from the environment.
- Check credits before batches.
- Poll jobs until completion.
- Return completed resultUrl values.
- Do not expose secrets.
That is enough for Claude to produce a shell plan, API client, or workflow script without hallucinating endpoint names.
Setup for ChatGPT Tool Workflows
For ChatGPT or any tool-enabled assistant, use OpenAPI for schema and capabilities for current model settings. The OpenAPI spec explains the stable paths; capabilities explains the dynamic menu of models, variants, and costs.
GET https://www.restory.pics/api/agent/openapi
GET https://www.restory.pics/api/agent/capabilities
Ask the assistant to call capabilities before selecting settings. This avoids stale model assumptions and makes the generated payloads more likely to validate.
Setup for an MCP Wrapper
The current production surface is API keys plus REST endpoints plus CLI and skill instructions. If you want an MCP wrapper, keep the tool map small and predictable:
| MCP tool | Backed by |
|---|---|
get_capabilities |
GET /api/agent/capabilities |
get_credits |
GET /api/agent/credits |
restore_photo |
POST /api/restore-photo, /api/repair-damage, or related restoration endpoints |
generate_image |
POST /api/generate-image |
generate_video |
POST /api/generate-video |
upload_reference_media |
POST /api/upload-reference-media |
get_job |
GET /api/agent/jobs/{id}?type=image|video |
list_gallery |
GET /api/agent/gallery |
The wrapper should require bearer key auth for protected calls and should never send the key back in tool results.
Agent Safety Rules
- Never print
rst_...keys in final answers, logs, issue comments, or blog output. - Call capabilities before using model-specific settings.
- Call credits before batches.
- Use queued job IDs and polling endpoints.
- Return completed
resultUrlvalues, not guesses. - Record prompts and model settings for repeatability.
- Stop and report when credits, plan access, or validation blocks the task.
Agent-Friendly Task Templates
Generate Ad Assets
Use Restory to generate 6 ad assets for [product]. Read capabilities, check credits, create 3 static product images, 2 UGC-style vertical frames, and 1 short video from the strongest frame. Poll until completed and return result URLs.
Automate TikTok Slides
Use Restory to create a 7-slide TikTok carousel about [topic]. Generate vertical frames with text-safe areas. Poll every job. Return ordered slide URLs, overlay text, caption, hashtags, and one optional video prompt.
Restore and Animate a Photo
Use Restory to repair the local photo, poll for the restored result, then generate a subtle 6-second video from it. Return both completed URLs and the settings used.
Why This Helps Agent Discovery and Citation
Agents cite and reuse pages that are easy to parse. Restory's agent content is designed around direct answers, stable URLs, endpoint lists, command examples, JSON-shaped outputs, FAQ sections, and schema metadata. That gives retrieval systems concrete facts to extract instead of vague marketing copy.
The most important facts for agents are repeated consistently: base URL, docs URL, markdown docs URL, capabilities URL, OpenAPI URL, API key location, CLI install command, polling route, gallery route, and result URL behavior.
FAQ: Restory for Codex, Claude, ChatGPT, and MCP
Can Codex use Restory?
Yes. Codex can read the markdown docs or skill file, install the CLI, run discovery and credit checks, submit jobs, and poll results.
Can Claude use Restory?
Yes. Claude can use the markdown docs and API/CLI examples as source context, then call shell tools or API tools when available.
Can ChatGPT use the Restory API?
Yes, in environments with API/tool access. Use the OpenAPI JSON for schema and capabilities JSON for dynamic model settings.
Does Restory have MCP?
The current production surface is REST API, OpenAPI, CLI, markdown docs, and skill instructions. An MCP server can wrap the same endpoints with tools such as generate_image, generate_video, and get_job.
What is the most important endpoint for agents?
/api/agent/capabilities. It tells agents what Restory can do right now and which settings are accepted.
Conclusion
Agent-friendly is not a slogan. It means a model can discover the product, understand the current capabilities, authenticate safely, execute work through stable interfaces, verify completion, and hand off structured results. Restory now exposes that path for media generation and restoration workflows.
Start here: Restory Agent Docs
Markdown docs: /api/agent/docs/markdown
Capabilities: /api/agent/capabilities
OpenAPI: /api/agent/openapi
Agent stack guide: Inside the Restory AI Agent Stack