What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI models and agents to interact with external tools and services in a structured way. Instead of crafting raw HTTP requests, your AI assistant discovers available tools and calls them using a standardized protocol. With deAPI’s MCP server, Claude, ChatGPT, Cursor, and other MCP-compatible clients can:- Generate images, videos, and audio directly within conversations
- Transcribe YouTube / X / Twitch / Kick / TikTok videos or audio files, and short voice clips in one quick call
- Search the live web and read web pages
- Remove image backgrounds and upscale images and videos
- Check pricing before running expensive operations
- Check your balance, usage and API keys
- Access all deAPI capabilities through natural language
Server Details
Create an API key at app.deapi.ai/settings/api-keys. Jobs run on your deAPI balance, so treat the key like a password.
Authentication
Every request carries your deAPI API key. Pick whichever way suits your client:- The deAPI sign-in window (recommended; works in claude.ai, Claude Desktop, ChatGPT, Claude Code, Cursor, VS Code, Codex, Gemini CLI and any client that supports OAuth): add the server URL and connect. A deAPI sign-in window opens, shows which application is asking (with its logo for well-known clients) and where the access goes, and asks for your API key. The key never goes into a config file. The server supports dynamic client registration and client ID metadata documents, with the Authorization Code flow and PKCE (S256).
- In a header (Claude Code, Cursor, VS Code, Codex, Gemini CLI and most other clients):
Authorization: Bearer <key>, orX-API-Key: <key>for a client that only lets you name one header. When both are sent,Authorizationis used. - OAuth with the pre-registered client (for clients where you enter OAuth credentials yourself): Client ID
deapi-mcp, Client Secret = your API key. No sign-in window is shown.
401 right away (or invalid_client during OAuth sign-in), so an authentication error from your client means the key needs fixing. Never put the key in the URL: the server only reads it from the headers above.
Available Tools
The deAPI MCP server exposes the following 54 tools:Image Generation & Manipulation
Video Generation & Processing
Audio & Speech
Web
Web search is in limited availability; accounts without access get a 404.
Embeddings
Prompt Enhancement
Utility
Account & API Keys
Reading the account and the keys needs an ADMIN key; any key can read its own details and usage. An API key gets a message pointing to the dashboard instead.
Creating, changing and deleting keys is off on mcp.deapi.ai, for safety: a new key’s secret would pass through the conversation, and a deleted key cannot be brought back.
create_api_key, update_api_key and delete_api_key change nothing there and answer with a link to app.deapi.ai/settings/api-keys, where you do it yourself. On a self-hosted server you can turn them on with DEAPI_KEY_MANAGEMENT_TOOLS=true; your client then asks you before each change.Working with Results
Generation tools wait for the job to finish and return its outcome in one call:result_urlpoints to the output file. Images, video and audio always come back this way.resultcarries text inline (transcripts, OCR, embeddings) whenreturn_result_in_responseistrue. WithWhisperLargeV3Ct2,resultis a JSON string withtext,languageand, when timestamps are requested,segments.price.amountis what the job cost.
return_result_in_response: false: the transcript stays out of the tool result and the tool returns result_url, a signed link to the full transcript file. This helps only if the client passes the link to the model: Parallel’s Task API, for example, replaces result_url with [redacted], so the agent never receives the transcript. With such clients, keep return_result_in_response: true and accept that only the part that fits in the client’s limit gets through (25,000 characters on Parallel).
Pricing a URL transcription. video_url_transcription_price accepts either video_url or duration_seconds, not both. With a URL, the price is read from the source itself. TikTok links can’t be quoted by URL — pass duration_seconds together with platform: "tiktok". The platform changes the price, so set platform whenever you quote by duration.
Webhooks. All 17 job tools accept webhook_url and an optional webhook_secret, and pass them to the API. deAPI then calls your endpoint when the job finishes, so your own systems are notified as well. The tool still waits and returns the result in the conversation. See Webhooks for the payload and signature.
Rate limits. A request refused with 429 is retried only after a short Retry-After; otherwise the tool answers at once with how long to wait and, for a job submission, a price quote or a key change, that nothing was processed or charged. A 429 while the tool is waiting for a job it already submitted does not fail the call: the tool answers as for a job still running (success: true, done: false, job_id, rate_limited: true), so the agent checks the job with check_job_status instead of submitting it again.
Refusals. A retired model (410) is named in the error together with the date it was retired and the model to use instead. A 403 says which case it is: the key’s IP allowlist does not include the server, the key needs the ADMIN role, or the account is suspended. The tools leave limits (sizes, durations, ranges) to the API and the model list from get_available_models: a value out of range comes back as the API’s 422, with every field it refused.
Titles and annotations. Every tool has a title (for example “Generate video”, “Price: OCR”, “Check balance”) and tells the client whether it only reads, changes anything, gives the same answer twice and reaches outside deAPI (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). Price quotes, get_balance, get_available_models, check_job_status and the account reads are read-only, so a client that honours the hints can run them without asking; tools that run a job are marked as actions that write, since each call is billed. openWorldHint is set on web_search and on every tool that takes a URL.
How to Connect
Claude (claude.ai and Claude Desktop)
claude.ai and the Claude Desktop app share the same connector settings. To use deAPI MCP tools in Claude conversations: Step 1. Create an API key at app.deapi.ai/settings/api-keys Step 2. Add the connector:- Open Customize → Connectors and choose Add custom connector
- Name it
deAPIand enter the server URLhttps://mcp.deapi.ai/mcp
To skip the sign-in window, open Advanced settings before adding the connector, choose Use your own OAuth client, and enter Client ID
deapi-mcp with your API key as Client Secret. Where your plan offers Request headers for custom connectors, you can also choose no sign-in and add the header Authorization: Bearer <your key>. On Team and Enterprise plans, an owner adds connectors under Organization settings.- “Using deAPI MCP, generate an image of a futuristic city at sunset”
- “With deAPI MCP, transcribe this YouTube video: [URL]”
- “With deAPI MCP, transcribe this Twitch video: [URL]”
- “With deAPI MCP, transcribe this TikTok with WhisperLargeV3Ct2: [URL]”
- “Check my deAPI MCP balance”
- “Using deAPI MCP, create a video of waves crashing on a beach”
Cursor IDE
To integrate deAPI MCP into Cursor for AI-assisted development: Step 1. Create an API key at app.deapi.ai/settings/api-keys Step 2. Open Cursor Settings:- Press
Cmd/Ctrl + Shift + P - Search for “Cursor Settings” or navigate to Settings → Cursor Settings
- Find the MCP or Model Context Protocol section
- Add a custom MCP server configuration in
~/.cursor/mcp.json(or.cursor/mcp.jsonin a project), in one of these ways:
- Sign-in window (recommended)
- API key in a header
- OAuth without the window
- “Using deAPI MCP, generate an image of…”
- “With deAPI MCP, transcribe this audio…”
- “Via deAPI MCP, check my balance”
ChatGPT
To use deAPI MCP tools in ChatGPT conversations:MCP is available in beta to Pro, Plus, Business, Enterprise, and Education accounts. The MCP apps work on both web and desktop, but Developer mode settings are only accessible in the web version at chatgpt.com.
- Go to Settings → Apps & Connectors
- Scroll to Advanced settings at the bottom
- Enable Developer mode
- Go back — a Create App button will appear next to Advanced settings
- Click Create App
- Fill in the following details:
Leave the OAuth client fields empty: ChatGPT registers itself, and a deAPI sign-in window asks for your API key. If ChatGPT asks for client credentials, enter Client ID
deapi-mcp and your API key as Client Secret.
Step 4. Check the risk acknowledgment checkbox (“I understand and want to continue”)
Step 5. Click Create
Step 6. Start using deAPI MCP by asking ChatGPT to generate images, transcribe videos, or use any other capability.
Example prompts:
- “Using deAPI MCP, generate an image of a cyberpunk cat”
- “With deAPI MCP, transcribe this YouTube video: [URL]”
- “Check my deAPI MCP balance”
- “With deAPI MCP, transcribe this Kick video: [URL]“
Claude Code
To use deAPI MCP in Claude Code, open a terminal and add the server in one of these ways.-s user makes it available in all your Claude Code sessions.
- Sign-in window (recommended)
- API key in a header
/mcp in Claude Code, pick deapi and choose Authenticate. The deAPI sign-in window opens in your browser: paste your API key and choose Allow access. Claude Code keeps the session and refreshes it on its own.VS Code (GitHub Copilot)
- Sign-in window (recommended)
- API key, asked once
Run MCP: Add Server from the Command Palette, choose HTTP and enter When the server first starts, VS Code asks you to sign in: paste your API key in the deAPI sign-in window and choose Allow access.
https://mcp.deapi.ai/mcp, or add it to .vscode/mcp.json:Codex
- Sign-in window (recommended)
- API key from an environment variable
codex mcp login opens the deAPI sign-in window in your browser: paste your API key and choose Allow access.Gemini CLI
- Sign-in window (recommended)
- API key in a header
/mcp auth deapi in Gemini CLI: the deAPI sign-in window opens in your browser. Paste your API key and choose Allow access.nanobot
- WebUI
- config.json
Open Apps → MCP, click Add MCP server and choose Custom. Fill in the server:
Under Advanced options, raise Tool timeout (seconds) from 30 to
300, so image and video jobs can finish. Click Save MCP server.YOUR_API_KEY with your actual deAPI key. nanobot registers the deAPI tools with an mcp_deapi_ prefix, e.g. mcp_deapi_text_to_image. If the key is wrong, nanobot logs 401 Unauthorized for the server and starts without its tools.
Any other MCP client
Use the server URLhttps://mcp.deapi.ai/mcp with the Streamable HTTP transport (sometimes just called “HTTP”). A client that supports OAuth needs no setup: it registers itself and opens the deAPI sign-in window, where you paste your key. Otherwise send your key as Authorization: Bearer <key> or X-API-Key: <key>. A client with fixed OAuth credentials can use Client ID deapi-mcp with your API key as Client Secret.
Self-Hosting
You can run the MCP server on your own infrastructure. The full source code is available at github.com/deapi-ai/mcp-server-deapi under the MIT license.Prerequisites
- Python 3.11 or higher
uv,pip, orcondafor package management- A deAPI API key from app.deapi.ai/settings/api-keys
Quick Start
The server is published on PyPI asdeapi-mcp:
http://localhost:8000. For external access, set a fixed key for signing OAuth tokens first; the server refuses to start beyond localhost without one:
PUBLIC_BASE_URL to the address clients use (for example https://mcp.example.com), so OAuth discovery and the sign-in window point there.
Docker Deployment
Cloud Deployment Options
The server can be deployed to any platform that supports Python or Docker containers: Railway, Fly.io, Heroku, DigitalOcean App Platform, AWS ECS, GCP Cloud Run, and others. Detailed deployment instructions are available in DEPLOYMENT.md in the repository.Connecting a Self-Hosted Server
Point your MCP client to your server URL instead of the defaulthttps://mcp.deapi.ai/mcp:
Supported Models
The MCP server provides access to all deAPI models. The tools take the same model slugs as the HTTP API, so a model added to the catalogue becomes usable over MCP straight away, with no server update.This table is a snapshot. The catalogue depends on your account: partner models require a Premium account, and some models are visible only to selected accounts. Treat
get_available_models as the source of truth.get_available_models tool to retrieve the full list with current specifications and limits. It returns the whole catalogue in one call, including the newest models. Tool descriptions also list each model’s request bounds, and for TTS models the supported languages and voices.
Usage Examples
Generate an Image
Ask your AI assistant:“Using deAPI MCP, generate an image of an astronaut riding a horse on Mars, photorealistic style”The assistant will call
text_to_image with appropriate parameters and return the generated image URL.
Transcribe a YouTube Video
“With deAPI MCP, transcribe this YouTube video with timestamps: https://www.youtube.com/watch?v=7qaiNfoMRts”The assistant calls
video_url_transcription and returns the full transcript.
Convert Text to Speech
“Using deAPI MCP, convert this text to speech with a British female voice: ‘Welcome to our platform’”The assistant calls
text_to_audio with the Kokoro model and appropriate voice settings.
Remove Background from Image
“Using deAPI MCP, remove the background from this product photo”The assistant calls
image_remove_background and returns a transparent PNG.
Transcribe X/Twitter Spaces
“With deAPI MCP, transcribe this Twitter Space: https://twitter.com/i/spaces/…”The assistant calls
audio_url_transcription and returns the full transcript.
Architecture
Smart Adaptive Polling
For async jobs, the server automatically polls for results with optimized intervals based on job type:
Polling uses exponential backoff (1.5× multiplier by default), so jobs receive fast initial checks while heavier workloads avoid unnecessary load.
Token Security
The MCP server does not store your API token. Authentication works at the connection level:- Remote hosted server: OAuth 2.0 Authorization Code with PKCE, through the deAPI sign-in window (clients register themselves) or the pre-registered client
deapi-mcp; or your API key in theAuthorization: BearerorX-API-Keyheader. With OAuth the key travels only encrypted inside the client’s tokens - Key check: the key is checked with deAPI when a client connects, and a key deAPI refuses gets
401immediately - Self-hosted server: the key is forwarded per request to the deAPI API
- Keys are never persisted or logged, and never read from the URL; tools do not accept
deapi_api_tokenas a parameter
When to Use MCP vs HTTP API
Use the MCP server when you want an AI agent to decide which tools to call, with which parameters, and in what order. Use the HTTP API + queue for typical backend integrations where you directly manage requests and results.
Troubleshooting
Connection Issues
- Verify your API key is valid and has sufficient balance
- Check the server URL is exactly
https://mcp.deapi.ai/mcp - For Claude and ChatGPT: If the deAPI sign-in window says the key was not accepted, copy the key again; if you entered OAuth credentials yourself, the Client ID must be
deapi-mcpand the Secret your API key - “Unverified application” in the sign-in window: the application registered itself and deAPI cannot confirm who runs it. Continue only if you started the connection and recognise the address shown under Access goes to
- For header-based clients: The header should be
Authorization: Bearer YOUR_API_KEY(with theBearerprefix) orX-API-Key: YOUR_API_KEY 401orinvalid_clientwhen connecting: deAPI did not accept the key. Copy it again from app.deapi.ai/settings/api-keys, or create a new one- “This application is not registered” in the sign-in window: start the connection again from your client. If it keeps happening, update the client or use the key in a header instead, and let us know on Discord
Tools Not Appearing
- Restart your MCP client (Claude, ChatGPT, Cursor) after configuration changes
- In Claude: Make sure you chose Allow access in the deAPI sign-in window
- In ChatGPT: Ensure Developer mode is enabled in Advanced settings
- Verify JSON syntax in configuration files (Cursor, VS Code, Claude Code)
- The account and key tools need an ADMIN key; an API key can only read its own details and usage
- Creating, changing and deleting keys is off on mcp.deapi.ai: those tools answer with a link to the dashboard
Jobs Stuck in Processing
- Use
check_job_statustool with the job ID to monitor progress - Large video generation or transcription jobs may take several minutes
- Check status.deapi.ai for system status
Remote Connection Issues (Self-Hosted)
- Test the server:
curl http://your-server:8000/healthshould return{"status": "healthy", ...}, andPOST /mcpwithout a key should return401 - Check server logs:
docker logs mcp-server-deapiorjournalctl -u mcp-server-deapi - Verify firewall rules allow the configured port
- For SSL issues, confirm certificates are valid and paths are correct in your proxy config