---
title: Authentication | RunAPI
description: Create an API key and authenticate requests to RunAPI.
url: https://runapi.ai/docs/guides/authentication.md
canonical: https://runapi.ai/docs/guides/authentication
locale: en
---

> HTML version: https://runapi.ai/docs/guides/authentication
> Site index for agents: https://runapi.ai/llms.txt

# Authentication

RunAPI uses API keys to authenticate API requests. Send the key with
every request that accesses your account or creates work.

## Choose the right key

* A standard API key calls the Task API, LLM API, and account endpoints.
  [Sign in](https://runapi.ai/login), then open the API Keys page to create one.
* A management key creates and governs standard API keys and guardrails.
  [Sign in](https://runapi.ai/login), then open the Management Keys page to create one,
  and use it only with Platform Management endpoints.

## Create an API key

Give each application its own key so you can rotate or revoke access
without interrupting other integrations. A key is bound to one account,
and requests can access only resources visible to that account.

Paid API calls are limited to 300 requests per minute per account. A
`429 Too Many Requests` response includes `Retry-After`,
`X-RateLimit-Limit-RPM`, `X-RateLimit-Remaining-RPM`, and
`X-RateLimit-Reset` headers.

## Authenticate a request

Send the API key as a bearer token in the `Authorization` header:

```http
Authorization: Bearer YOUR_API_TOKEN
```

For example, request your current balance with cURL:

```shell
curl "https://runapi.ai/api/v1/me/balance" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Hosted MCP OAuth

Remote MCP clients connect to `https://mcp.runapi.ai/mcp` and use the
canonical OAuth resource `https://mcp.runapi.ai` to discover the RunAPI
authorization flow automatically. Sign in or create a RunAPI account,
select an Account, and approve access without creating or sharing an API
key.

RunAPI supports Dynamic Client Registration, authorization code with
S256 PKCE, and rotating refresh tokens for Hosted MCP access.

OAuth discovery endpoints:

* Protected Resource Metadata:
  `https://runapi.ai/.well-known/oauth-protected-resource`
* Authorization Server Metadata:
  `https://runapi.ai/.well-known/oauth-authorization-server`

[Sign in](https://runapi.ai/login), then open Authorized apps at
`/settings#oauth-connections` to review or revoke client access.

## Keep keys secure

* Store API keys in a secret manager or encrypted credentials.
* Never commit a key to source control or expose it in browser code.
* Rotate a key immediately if it may have been disclosed.
* Use separate keys for development and production.

## Troubleshoot authentication

* A `401 Unauthorized` response means the key is missing, malformed,
  revoked, or invalid.
* A `403 Forbidden` response means the key is valid but its credential
  class or account role cannot perform the operation.
* Confirm the header starts with `Bearer`, followed by one space and the
  complete key.
* Confirm the key belongs to the account whose resources you are
  requesting.

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [Model Catalog](https://runapi.ai/models.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Providers](https://runapi.ai/models)
- [Documentation](https://runapi.ai/docs/guides)
- [SDKs](https://runapi.ai/sdk.md)
- [CLI](https://runapi.ai/cli.md)
- [MCP Server](https://runapi.ai/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Cursor API Setup](https://runapi.ai/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/contact.md)
- [Contact](https://runapi.ai/contact.md)
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "TechArticle",
    "headline": "Authentication",
    "description": "Create an API key and authenticate requests to RunAPI.",
    "url": "https://runapi.ai/docs/guides/authentication",
    "mainEntityOfPage": "https://runapi.ai/docs/guides/authentication"
  }
]
```
