Connect Pitlane over MCP
Connect Claude Code, Codex, Cursor, VS Code, Windsurf, or Claude Desktop to Pitlane's remote Streamable HTTP MCP endpoint. Pick your client, copy one snippet, paste your API key, and your agent can call generate.
Endpoint details
- URL https://api.pit-lane.dev/mcp
-
Transport
Stateless Streamable HTTP (
POSTonly;GETandDELETEreturn405) -
Authentication
Authorization: Bearer <key>(keys start withpit_) -
Protocol
2025-11-25(also accepts2025-06-18,2025-03-26,2024-11-05)
1. Create an API key
Sign in and open API Keys in the web app. Name the key after the machine or client using it, and set an optional monthly credit cap. Real keys start with pit_ and are shown once on creation (only a SHA-256 hash is stored).
For Claude Code, Codex, or the curl test below, export your key in your shell:
export PITLANE_API_KEY="pit_your_key_here"
2. Pick your client
Select your AI client and copy its configuration snippet. Replace pit_your_key_here with your own key or reference $PITLANE_API_KEY.
Export PITLANE_API_KEY in your shell, then register the remote HTTP MCP server once:
claude mcp add --transport http pitlane https://api.pit-lane.dev/mcp --header "Authorization: Bearer $PITLANE_API_KEY"
Export PITLANE_API_KEY in your shell and add this block to ~/.codex/config.toml:
[mcp_servers.pitlane]
url = "https://api.pit-lane.dev/mcp"
bearer_token_env_var = "PITLANE_API_KEY"
Add this to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
{
"mcpServers": {
"pitlane": {
"url": "https://api.pit-lane.dev/mcp",
"headers": {
"Authorization": "Bearer pit_your_key_here"
}
}
}
}
Save this in .vscode/mcp.json inside your workspace. VS Code prompts for your API key as a hidden password input on first connect:
{
"inputs": [
{
"type": "promptString",
"id": "pitlane-key",
"description": "Pitlane API key",
"password": true
}
],
"servers": {
"pitlane": {
"type": "http",
"url": "https://api.pit-lane.dev/mcp",
"headers": {
"Authorization": "Bearer ${input:pitlane-key}"
}
}
}
}
Add this entry to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pitlane": {
"serverUrl": "https://api.pit-lane.dev/mcp",
"headers": {
"Authorization": "Bearer pit_your_key_here"
}
}
}
}
Claude Desktop's config file only starts local commands, so connect through mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"pitlane": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.pit-lane.dev/mcp",
"--header",
"Authorization:${PITLANE_AUTH}"
],
"env": {
"PITLANE_AUTH": "Bearer pit_your_key_here"
}
}
}
}
Node.js (with npx) is required on your machine to run mcp-remote.
3. Test the connection
Send a JSON-RPC initialize request with curl to verify your key and endpoint before starting a session:
curl -i -X POST https://api.pit-lane.dev/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PITLANE_API_KEY" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl-test","version":"1.0"}}}'
A working setup returns HTTP 200, header MCP-Protocol-Version: 2025-11-25, and a JSON-RPC result like this:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-11-25",
"capabilities": {
"tools": {
"listChanged": false
}
},
"serverInfo": {
"name": "pitlane",
"version": "1.0.0"
},
"instructions": "Pitlane Roblox asset generation API. Call list_job_types to inspect credit prices, create_upload to upload reference images or source files, generate to submit an asynchronous job, and get_job to poll until completion and obtain short-lived download links."
}
}
Available tools
Once connected, your agent has access to seven tools. Every tool except generate costs 0 credits:
| Tool | Purpose |
|---|---|
| get_balance | Returns available credits by bucket (subscription, grant, topup), plan status and renewal/end dates, and this API key's monthly cap and remaining allowance. |
| list_job_types | Lists enabled asset job types with base credit prices, option-based quote rules (when applicable), upload requirements, and one-line descriptions. |
| create_upload | Returns an upload_id, required headers, a ready curl -X PUT command, and a 15-minute size-bound presigned PUT URL for reference images (up to 20 MB), .glb meshes (up to 50 MB for rig), or videos (up to 50 MB for video_animation). |
| generate | Validates inputs, runs content moderation, reserves the quoted credit price, and queues an asynchronous job. Returns job_id, units, credits_reserved, and a suggested poll interval immediately. |
| get_job | Polls a job by job_id. Returns signed resource_link outputs with file sizes and SHA-256 hashes when succeeded, or error details and returned credits when failed or canceled. |
| list_assets | Lists visible generated assets with fresh short-lived download links, optional job_id and kind filters, and cursor pagination. Retention is 30 days on free accounts and unlimited on active subscriptions. |
| cancel_job | Cancels a queued job and returns all reserved credits to your balance. Jobs already in running state cannot be canceled and will finish and be charged. |
How jobs work
- Submit returns immediately: calling
generatevalidates inputs, runs content moderation (rejected requests cost 0 credits), reserves the quoted credit price (fixed or scaled by options such ascount,duration_seconds,text, or uploads), and returns ajob_idinqueuedstate with a suggestedpoll_interval_seconds. Pass an optionalidempotency_key(or rely on automatic retry deduplication) to avoid duplicate jobs. - Poll with get_job: your agent calls
get_jobas status moves fromqueuedtorunningand then tosucceeded,failed, orcanceled. - Short-lived download links: completed outputs are returned as 15-minute presigned HTTPS
resource_linkitems plus structured metadata, never inline base64 blobs. If a link expires, callget_joborlist_assetsto fetch a fresh one. - Refunds and cancellation: if a job fails, reserved credits are returned automatically. You can cancel a job with
cancel_jobwhile it is stillqueuedfor a full credit return; once a job isrunning, it cannot be canceled and will finish and be charged.
Spend cap per API key
Every API key supports an optional monthly credit cap, configured on API Keys. Monthly spend is tracked per UTC calendar month and counts both open holds (reserved credits) and settled jobs for that key. When a key's monthly spend plus the quoted cost of an incoming generate call would exceed its cap, the server rejects the request before reserving credits.
Give each developer, CI runner, or coding client its own key with a cap matching its role. Revoking a key takes effect immediately without rotating other keys.
Errors
Transport and auth failures return HTTP status codes with JSON bodies (ok: false, reason, message). Tool execution failures return HTTP 200 with an MCP tool result where isError is true:
| Status | Reason | Cause |
|---|---|---|
| HTTP 401 | missing_api_key, invalid_api_key, key_revoked | Missing Authorization: Bearer <key> header, unknown key, or revoked key. |
| HTTP 403 | origin_not_allowed, account_blocked | Request Origin header is not an allowed Pitlane origin, or the account is blocked. |
| HTTP 400 | unsupported_protocol_version | MCP-Protocol-Version header is not in the supported list (2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05). |
| HTTP 405 | method_not_allowed | Sent GET or DELETE to /mcp. This stateless endpoint accepts POST only. |
| Tool error (isError: true) | key_monthly_cap_exceeded | Returned by generate with "This API key has reached its monthly credit cap." before reserving credits. |
| Tool error (isError: true) | insufficient_credits | Returned by generate with "Insufficient credits to submit this job." Top up or upgrade (billed in USD) on Billing. |