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
- In the dashboard, open Keys → Provider Keys and select Add key.
- Choose the provider.
- Enter a display name (for example,
Production OpenAI). - 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
| Provider | Where to get a key |
|---|---|
| OpenAI | platform.openai.com |
| Anthropic | console.anthropic.com |
| aistudio.google.com | |
| Groq | console.groq.com |
| Mistral | console.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
| Symptom | Cause | Fix |
|---|---|---|
401 from the provider | Your stored provider key is invalid or revoked | Update the key under Keys → Provider Keys. |
400 unknown model | Wrong provider/model string | Check the spelling against Providers and models. |
| Requests still use managed access | Stored key is deactivated | Activate it on the Provider Keys page. |
Next steps
- See every supported model: Providers and models
- Attribute spend to prompts and users: Track prompt costs
Last updated on