Docs / AutenticaciónAuthenticationMarkdown

Autenticación

Toda llamada a la API y al MCP se autentica con una API key en la cabecera Authorization. La misma key sirve para REST, MCP y CLI.

Tipos de key#

KeyDe quiénDatosCobraHoy
sk_test_sandboxPública, compartidaDe ejemploNoDisponible
sk_test_...Tu cuentaDe ejemplo, fijosNoCon el registro
sk_live_...Tu cuentaRealesSí, en créditosCon el registro

El registro todavía no está abierto: hoy solo existe la sandbox. Todo lo que construyas con ella funciona igual con una key de tu cuenta.

Cabecera#

http
Authorization: Bearer sk_test_sandbox

La key va siempre en la cabecera, nunca en la URL. Sin key, o con una key que no existe, la API responde 401:

json
{
  "type": "https://pricto.dev/docs#unauthorized",
  "title": "API key ausente o inválida",
  "status": 401,
  "code": "unauthorized",
  "detail": "Falta la API key.",
  "hint": "Envía el header 'Authorization: Bearer <api_key>'. Para probar con datos de ejemplo usa la key pública sk_test_sandbox.",
  "request_id": "req_421eba4eb1a7494caa28",
  "docs_url": "https://pricto.dev/docs#unauthorized"
}

Sin key se pueden leer /v1/status, /v1/openapi.yaml, /llms.txt y estas docs.

Guardar y rotar keys#

  • Guárdala en una variable de entorno (PRICTO_API_KEY) o en el gestor de secretos de tu plataforma. No la pongas en código que corre en el navegador ni en un repositorio.
  • Usa una key por aplicación o entorno: si una se filtra, revocas solo esa.
  • Para rotar: crea una key nueva, despliégala, verifica que tu aplicación la usa y revoca la anterior. Crear y revocar keys se hace en la consola, que abre con el registro.
  • Cada plan incluye un número de keys: 1 en Free, 3 en Builder, 10 en Pro, 25 en Business y 100 en Scale.

MCP y OAuth#

  • https://pricto.dev/mcp/sandbox: sin login, con los datos de ejemplo.
  • https://pricto.dev/mcp: con tu key en Authorization: Bearer, igual que la API. Claude Code, Cursor, VS Code y los conectores personalizados de Claude aceptan esa cabecera.
  • OAuth: el servidor MCP ya publica su metadata de recurso protegido (RFC 9728) en /.well-known/oauth-protected-resource/mcp, pero el servidor de autorización todavía no está activo. Cuando lo esté, Claude y ChatGPT podrán conectarse con tu cuenta sin copiar una key. No tiene fecha todavía; lo avisamos en las novedades.

Authentication

Every API and MCP call is authenticated with an API key in the Authorization header. The same key works for REST, MCP and the CLI.

Key types#

KeyWhoseDataChargesToday
sk_test_sandboxPublic, sharedSampleNoAvailable
sk_test_...Your accountSample, fixedNoWith sign-up
sk_live_...Your accountRealYes, in creditsWith sign-up

Sign-up is not open yet: today only the sandbox exists. Whatever you build with it works the same with a key from your account.

Header#

http
Authorization: Bearer sk_test_sandbox

The key always goes in the header, never in the URL. With no key, or a key that doesn't exist, the API answers 401:

json
{
  "type": "https://pricto.dev/docs#unauthorized",
  "title": "API key ausente o inválida",
  "status": 401,
  "code": "unauthorized",
  "detail": "Falta la API key.",
  "hint": "Envía el header 'Authorization: Bearer <api_key>'. Para probar con datos de ejemplo usa la key pública sk_test_sandbox.",
  "request_id": "req_421eba4eb1a7494caa28",
  "docs_url": "https://pricto.dev/docs#unauthorized"
}

Without a key you can read /v1/status, /v1/openapi.yaml, /llms.txt and these docs.

Storing and rotating keys#

  • Keep it in an environment variable (PRICTO_API_KEY) or your platform's secret manager. Don't put it in code that runs in the browser or in a repository.
  • Use one key per application or environment: if one leaks, you revoke only that one.
  • To rotate: create a new key, deploy it, check your application uses it and revoke the old one. Creating and revoking keys happens in the console, which opens with sign-up.
  • Each plan includes a number of keys: 1 on Free, 3 on Builder, 10 on Pro, 25 on Business and 100 on Scale.

MCP and OAuth#

  • https://pricto.dev/mcp/sandbox: no login, sample data.
  • https://pricto.dev/mcp: with your key in Authorization: Bearer, like the API. Claude Code, Cursor, VS Code and Claude custom connectors accept that header.
  • OAuth: the MCP server already publishes its protected resource metadata (RFC 9728) at /.well-known/oauth-protected-resource/mcp, but the authorization server isn't active yet. When it is, Claude and ChatGPT will connect with your account without copying a key. There's no date yet; we'll announce it in the updates.