Authenticate Metal API requests with server-to-server API keys: create a key in the app, manage keys with the API, and handle 401 Unauthorized errors.
The Metal API uses API keys to authenticate requests. Each key belongs to a single organization, and every request is automatically scoped to that organization’s data.API keys are service-level, server-to-server credentials. They are not OAuth tokens and they do not impersonate each end user of a customer-built app. For per-user access from Claude, ChatGPT, or Cursor, use the Metal MCP server instead. See Choose the API or MCP for the two models side by side.
The secret key is returned only once, when the key is created. If you lose it, delete the key and create a new one. Never expose it in client-side code, browsers, or mobile apps. API keys are for server-to-server use only.