MCP Server
FastMetal runs a remote MCP server, so any agent that speaks the Model Context Protocol can call FastMetal models as tools. There is nothing to install: point your agent at one URL and authenticate with the API key you already have.
Why use this instead of the base URL?
Both work, and they solve different problems. Setting your agent’s base URL to FastMetal is all-or-nothing — the entire session runs on one FastMetal model. The MCP server instead lets you keep your current model and reach FastMetal as tools.
- Get a second opinion from another model without leaving the one you are working in.
- Generate and edit images from inside your agent. A text base URL cannot do this at all, because it requires a tool call.
- Look up live model pricing and your remaining balance mid-session.
Endpoint and authentication
Connect over Streamable HTTP and send your FastMetal API key as a bearer token. This is the same key you would use against the API directly — note that it is not the api.fastmetal.ai hostname, which serves the inference API and has no MCP route.
https://mcp.fastmetal.ai/mcpClaude Code
Add the server with the MCP CLI. Claude Code expands the environment variable when it starts, so the key itself never gets written into your config file — export FASTMETAL_API_KEY in your shell profile first.
claude mcp add --transport http fastmetal https://mcp.fastmetal.ai/mcp \
--header "Authorization: Bearer ${FASTMETAL_API_KEY}"Run /mcp in a session to confirm it connected. The FastMetal tools will appear in the tool list.
Codex CLI
Add a server entry to your Codex config. Servers are managed with the codex mcp command; Codex has no /mcp slash command.
[mcp_servers.fastmetal]
url = "https://mcp.fastmetal.ai/mcp"
[mcp_servers.fastmetal.http_headers]
Authorization = "Bearer sk-your-fastmetal-key"Other clients
Any client that supports remote MCP servers with custom headers will work, including Cursor, OpenCode and Claude Desktop. Most accept a JSON block of this shape.
{
"mcpServers": {
"fastmetal": {
"type": "http",
"url": "https://mcp.fastmetal.ai/mcp",
"headers": {
"Authorization": "Bearer sk-your-fastmetal-key"
}
}
}
}Available tools
Eleven tools are exposed. Model discovery and balance checks are free; the rest are charged at normal rates.
askSend one prompt to a specific model and get its reply, with token counts and the exact cost in yen.compareSend the same prompt to several models at once and see each reply side by side with its own cost.generate_imageGenerate an image from a text prompt. Returns a short-lived download link (ask your agent to save it) plus the real per-image cost. Pass inline:true in clients that render images.analyze_imageAsk a vision-capable model about an image, given as a URL or a data URL.generate_videoGenerate a short video from a text prompt with your choice of configured video model. Waits up to 45 seconds for the render, then returns either a time-limited download link or a job_id to pick up later.get_videoResume a video started by generate_video using its job_id, and get the download link once it is ready. Free — the video was charged at submission.list_modelsList every model your key can reach, with live pricing per million tokens or per image.get_modelFull detail for a single model, including pricing and whether it supports vision.quotaYour remaining balance, spend and budget.health_checkVerify the connection and that your key is valid.model_compatibilityWhich models reliably drive an agentic coding loop, based on probe runs.Each video model bills its own flat price per generation regardless of prompt (the tool description lists the menu), charged the moment the job is accepted, so get_video costs nothing however often you call it. Each key has a daily video spend budget (¥1,250 by default). Download links expire, so ask your agent to save the file.
Testing with curl
The protocol is JSON-RPC 2.0 over a single POST. The Accept header must list both application/json and text/event-stream — that is what identifies the request as Streamable HTTP.
curl -X POST https://mcp.fastmetal.ai/mcp \
-H "Authorization: Bearer $FASTMETAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"quota","arguments":{}}}'Responses come back as server-sent events, so the body arrives as a data: line wrapping the JSON result. Useful methods are initialize, tools/list and tools/call.
Troubleshooting
401 — Missing FastMetal API key
The Authorization header is not reaching the server. Check the syntax (Authorization: Bearer sk-...) and confirm your environment variable is exported.
401 — Invalid or revoked FastMetal API key
The key was rejected. Confirm it works directly against the inference API with a plain curl request to /v1/models.
429 — Too many requests
Repeatedly presenting a key the gateway rejects is capped more tightly than normal traffic, usually because a stale key is stuck in a config that keeps retrying. Fix the key; the limit clears within a minute and the Retry-After header says exactly when. A key that has authenticated once is served from cache and is never rate limited.
An empty or truncated reply
Reasoning models spend tokens thinking before they answer, so a low max_tokens can be used up before any answer is produced. Retry with a higher max_tokens.