Skip to Content
How-to guidesUse your own provider keys

Use your own provider keys

PlainField can call providers two ways:

  • Managed access — use PlainField’s provider access out of the box. You do not need any provider account; just send requests with your PlainField API key.
  • Your own keys — add your provider account’s API key so requests run under your own provider billing, rate limits, and data terms.

This guide shows how to add your own keys and how to select a model.

Add a provider key

  1. In the dashboard, open Keys → Provider Keys and select Add key.
  2. Choose the provider.
  3. Enter a display name (for example, Production OpenAI).
  4. Paste your provider API key and select Save.

PlainField encrypts the key at rest. After saving, PlainField uses it when you call that provider.

Supported providers for your own keys

ProviderWhere to get a key
OpenAIplatform.openai.com
Anthropicconsole.anthropic.com
Googleaistudio.google.com
Groqconsole.groq.com
Mistralconsole.mistral.ai

You can deactivate or activate a stored key from the same page without deleting it.

Select a model

Use a provider/model string in the model field. PlainField routes by the prefix:

curl -X POST https://api.plainfield-ai.com/ai/chat/completions \ -H 'Authorization: Bearer pt_live_...' \ -H 'Content-Type: application/json' \ -d '{ "model": "anthropic/claude-3-5-sonnet", "messages": [{"role": "user", "content": "Hello!"}] }'

For the full per-provider model lists, see Providers and models.

Common errors

SymptomCauseFix
401 from the providerYour stored provider key is invalid or revokedUpdate the key under Keys → Provider Keys.
400 unknown modelWrong provider/model stringCheck the spelling against Providers and models.
Requests still use managed accessStored key is deactivatedActivate it on the Provider Keys page.

Next steps

Last updated on