Skip to main content
Quick reference for auth and supported clients.

Authentication

Requests without a valid API key or OAuth access token receive a 401 Unauthorized response with OAuth discovery metadata.
The MCP server accepts either the same API key as the REST API or an OAuth access token. Send an API key as Authorization: Bearer gx_… or, for clients such as Anthropic that use their own credential header, as x-api-key: gx_…. Both forms use the same validation, rate limits, scopes, and credit accounting. OAuth-only clients such as Claude Desktop discover Magica’s authorization server, register automatically, and ask you to sign in. See API Reference → Authentication for how to create and manage keys.

get_pricing compatibility

New integrations should read pricingDetails for structured pricing and estimatedCost for a formatted estimate. Existing integrations may continue to read costConfig, costSummary, estimatedCredits, and estimationSource; Magica keeps those fields populated during the migration window. They will not be removed without a versioned replacement and a separate deprecation notice. Estimates are not guaranteed final charges. Read pricingApproach, note, and the billing units in pricingDetails before calculating a budget. Use get_model_schema and get_pricing for the selected tool’s authoritative inputs, rates, billing defaults, exclusions and settlement rules. Use modelId: "tool_pricing_catalog" to discover tool billing categories, then query the exact tool or model ID. Include research, compute, connected-app and reasoning usage when relevant, not only generation. Read the returned coverage notes before combining estimates; unknown pricing must not be assumed to mean zero cost. Pricing discovery does not grant execution permission or expose a tool that is unavailable on the current interface. Research and planning can incur charges before generation approval. Execution charges remain server-controlled.

Local file uploads

Use upload_file to upload a local file in three steps:
  1. Call upload_file with the original file_path. Keep the returned media_id and upload instructions.
  2. Run the returned curl PUT command with the file’s bytes and wait for it to exit successfully.
  3. Call upload_file with action: "confirm" and that media_id. Do not include file_path or url when confirming.
The upload session and signed upload URL each expire after one hour. Successful confirmation returns a permanent storage URL; it does not create a media-library catalog row. The PUT command itself does not return the permanent URL.

Confirmation recovery

Confirmation errors include a stable code and a boolean retryable, alongside the error message. Here, retryable: true means confirmation can be retried automatically without correcting the upload or creating a new session. The HTTP statuses below describe the underlying API response.

Compatibility

Media generation and supported media utilities share the execute_tool({ tool_name: "generate", input: { modelId, ...fields } }) contract. search_tools lists only models available to this caller, and get_model_schema supplies the input contract. Legacy direct utility names in tool_name remain accepted aliases; existing clients do not need to migrate their stored calls. See Available Tools for an example. Works with any MCP client that supports the Streamable HTTP transport or HTTP-based MCP configs.

Claude Desktop

Claude Code

Codex

Cursor

Windsurf

Other MCP clients