The error
Find your scenario
Playground or UI test fails
Completions API fails
Admin API fails
Logs & analytics fail
MCP operations fail
Listing models fails
Something else
Need scope reference?
Understand API key types
Before fixing the error, understand the two key types and how scopes work.Workspace API keys vs Admin API keys
- Workspace API keys
- Admin API keys
- User — For UI/Playground operations
- Service — For backend automations
- Completions and all data-plane operations
- Prompts, configs, providers within the workspace
- Cannot access other workspaces
workspace_id as a query parameter (for GET/list requests) or in the request body (for POST/PUT requests). Use a workspace UUID or slug. Workspace API keys are locked to their own workspace and can’t access other workspaces.How permission scopes work
Every API key has permission scopes that control which operations it can perform. Scopes are granular —providers.list does not grant providers.read. Each action requires its own scope.
Enable the specific scopes needed when creating or editing an API key:
Workspace API key permissions
Workspace API key permissions

Workspace API key — permission scopes available when creating or editing a key
Admin API key permissions
Admin API key permissions

Admin API key — permission scopes available when creating or editing a key
Playground and UI test requests
Why it happens
Playground, Prompt Studio, and Model Catalog test requests require a Workspace User API key. Service keys don’t work — the UI needs to authenticate your individual session.Common triggers
- Only Service API keys exist (no User key)
- User API key is missing the
completions.writescope - Multiple User API keys exist, and not all have required scopes
Fix
Open workspace API keys
Find or create a User API key
Enable completions.write
- Completions >
write(required for all inference calls) - Any additional scopes needed (e.g.,
prompts.read,configs.read)
Refresh and retry
Completions API and data-plane operations
What you need to know
Thecompletions.write scope gates all data-plane endpoints — not just chat completions.
Endpoints requiring completions.write
Why it happens
Your API key is missing thecompletions.write scope, or you’re using an Admin API key (Admin keys can’t call data-plane endpoints).
Fix
Use a Workspace API key
Enable completions.write
write.Update your code
Listing available models
GET /v1/models requires either completions.write or virtual_keys.list.
Admin API operations
The Admin API covers integrations, providers, users, workspaces, API key management, and other control-plane operations. Each operation requires specific scopes.Integrations (providers and models)
Users, workspaces, and API key management
Resource management (prompts, configs, guardrails, providers)
virtual_keys.* and providers.* — both may be needed depending on the operation.Fix
Edit the API key and add the required scopes. When in doubt, use Select All to grant all permissions.Logs, feedback, analytics, and audit logs
- Viewing & exporting
- Ingesting & writing
MCP servers and integrations
- MCP servers (workspace)
- MCP integrations
General troubleshooting
If none of the above scenarios match, work through these checks:1. Verify API key type
1. Verify API key type
2. Check permission scopes
2. Check permission scopes
- Having
listbut notread(or vice versa) - Having
readbut notwriteorcreate - Missing
completions.writefor inference calls
3. Verify user role
3. Verify user role
4. Common pitfalls
4. Common pitfalls
- Wrong key type — Using Admin key for completions, or Service key for Playground
- Plan restriction — Some Admin API endpoints require Enterprise plans
- Stale session — Log out and back in, or clear browser cache
- Multiple User API keys — All User keys need the required scopes
5. Still stuck?
Contact support@portkey.ai with:- Workspace ID
- Full error response (including
request_id) - Endpoint called
- API key type (Admin / Workspace User / Workspace Service)
Complete scope reference
Admin API key — all scopes
Admin API key — all scopes
Workspace API key — all scopes
Workspace API key — all scopes

