FastMetal
ModelsPricingDocsBlogComparisonApps
30% off, limited timeDeepSeek V4.1 Flash 1017, run in Japan, is 30% off until December 4 (JST)See details

API

  • Overview
  • Getting Started
  • Models
  • Reasoning Control
  • Video Generation
  • Structured Decisions
  • Media Uploads
  • Speech
  • Transcription
  • Music
  • Sound effects

Concepts

  • LLM API concepts
  • Errors and limits

Agents

  • All guides
  • MCP Server
  • Octofriend
  • Hermes
  • Claude Code
  • Crush
  • Opencode
  • GitHub Copilot
  • Cursor
  • DeepSeek Harness
  • OpenClaw
  • Xcode Intelligence

OpenAI Reference

  • /models
  • /chat/completions
  • /completions

Anthropic Reference

  • /messages
  • /messages/count_tokens

Platform Reference

  • /key/info

Help

  • FAQ

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 images and videos 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/mcp
Use a dedicated key with a spend cap rather than your main key. The key lives in an agent config file, so a capped key limits the damage if that file is ever exposed.

Claude 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.

~/.codex/config.toml
[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

Fifteen tools are exposed. Model discovery, balance checks, image uploads and price 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 an estimated cost in your key's currency (list rates, before any cache discount; none for auto).
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, with the file's width, height, frame count and length. Free: the video was charged at submission.
decideGive a decision model a situation and named questions, and get typed answers back (a choice, a true/false probability, a score) instead of prose. For classifying, routing or gating inside an agent's own logic, where an answer you can branch on beats a paragraph you have to parse. Billed flat per accepted request.
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.
create_media_uploadGet a one-time URL for one image (PNG, JPEG or WebP, up to 10 MB) and upload it from your own shell with curl -T. The returned media id works as a video frame, or as an input image of edit_image, once the upload is ready. Uploads are kept until deleted and appear in your Studio Library. Free.
get_mediaCheck one media id: its status (pending until the file arrives and is checked, then ready), its type, its size in bytes, and its width and height in pixels. Free.
edit_imageEdit or combine images you already stored, given as media ids in the order your prompt refers to them, up to the model's limit (list_models shows it), and get one new image as a short-lived download link with a media id of its own. Billed only when an image comes back: the price of one image at its quality, plus a price for each input image.

Each video is billed at the price of the spec requested (the model's default spec when no option is sent), whatever the prompt; the tool description lists the menu. It is 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 on a yen key, $8 on a US-dollar key). Download links expire, so ask your agent to save the file.

generate_video, generate_image and edit_image take dry_run: true, which returns what the call would cost (for a video, also what is left of the key's daily video budget) and makes, sends and bills nothing. It does not check your balance, your limits or whether the host is available, so the real call can still be refused.

To start a video on your own image, upload it with create_media_upload, then pass its media id to generate_video as first_frame; models that take an end frame also take last_frame. A generate_image or edit_image result has a media id too, usable as a frame or as an input image of edit_image for 24 hours after it was made. By default only the key that uploaded or made an image can use it; to use it from another key, mark the image Available to all my keys, or give that key whole-library access on the keys page. On Seedance 2.0 Fast a video with a frame is sold at the dearest shape of the size tier asked for: with size left out, the size is set to that shape and the result shows it with its price, and a size you choose that is not that shape is refused.

edit_image takes media ids only, never a URL or image data: upload each image with create_media_upload first, or use a generate_image or edit_image result from the last 24 hours. The keys that may use an image are the same as for a frame. Pass dry_run: true to see for free the amount the gateway will bill. An edit that returns no image costs nothing.

A decision costs the same whatever you ask, so asking every question that fits in one call is the cheapest way to use it. The per-call question count and body size are fixed per model; a request that exceeds them, or that is malformed, is rejected and costs nothing. See the structured decisions API page for the full shape.

Every inference and image call runs on your own key, so usage draws down your prepaid balance exactly as a direct API call would.

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.

Product

  • Pricing
  • AI cost calculator
  • Apps
  • Discover
  • Studio
  • For business
  • Partners
  • For providers
  • API Docs

Guides

  • Claude Code
  • GitHub Copilot
  • Cursor
  • DeepSeek Harness
  • Getting Started

API Reference

  • OpenAI Compatible
  • Anthropic Compatible

Compare Alternatives

  • vs OpenRouter
  • vs Lolipop! AI Gateway
  • vs OrcaRouter
  • vs Anthropic Direct
  • vs OpenAI Direct
  • vs Overseas Hosting
  • vs Local LLMs
  • Model vs model
  • Answers side by side
  • Rankings by use case
  • All comparisons

Account

  • Chat
  • Usage
  • Profile

Legal

  • Newsletter
  • Contact
  • Company Information
  • Terms of Service
  • Privacy policy

The AI Brief, weekly

New models, agents and harnesses, once a week. What is in it and our privacy policy.

© 2026 FastMetal. All rights reserved.

team@fastmetal.ai

Leaderboard data: LMArena leaderboard dataset (lmarena-ai/leaderboard-dataset), CC BY 4.0; category names mapped and ratings rounded by FastMetal.