persona.providers — /api/v1/developer/providers.
A Provider is an OpenAI-compatible endpoint + API key that Agents in your Project can reference.
Control-plane only: there is no ExternalUser ownership concept for Providers.
Ownership & scoping
- Providers are Domain-scoped, never per-user. On a runtime-plane client (
externalUserIdset),list()returns an empty array andget()/update()/delete()/testConnection()/getModels()return a 404PersonaApiError— not because the Provider doesn’t exist, but because that credential can never be its owner (existence-hiding, same as everywhere else). list()has no pagination envelope and nopage/limit/searchparams — Providers have no discovery concept, so it returns a plainProvider[].
Methods
create(input, idempotencyKey?)
Creates a new Provider.label, baseURL, apiKey, and defaultModel are required.
apiKeyis write-only — it never appears on the returnedProvideror any later response.isDefault(optional, defaultfalse): at most one Provider per Domain may be the default. The default Provider is used as the fallback when an Agent has noproviderId.- The optional trailing
idempotencyKeyis sent as theIdempotency-Keyheader — see Idempotency.
list()
list(). Same result whether
or not the client asserts an external user.
get(providerId)
Fetches one Provider by itsid (note: Providers use id, not _id). Throws
PersonaApiError (404) if it doesn’t exist or isn’t owned by this credential’s Domain.
update(providerId, input)
Partially updates a Provider — only the fields you pass are changed.apiKeyis optional here: omitting it leaves the existing key untouched; passing a new one replaces the stored key entirely.
delete(providerId)
Deletes a Provider. Rejects withPersonaApiError if any Agent still references it — call
getUsage() first to check. Returns void.
testConnection(providerId)
Makes a live call to the Provider’s endpoint to verifybaseURL/apiKey work.
- Returns
{ success: boolean, message: string }. success: falsemeans the call reached the endpoint but it rejected the credentials/URL — that’s a result, not a thrown error. A genuinely unreachable endpoint (DNS failure, etc.) throws instead.
getModels(providerId)
Lists the models this Provider’s endpoint reports as available — e.g. for populating a model picker in your own UI. ReturnsProviderModel[] where ProviderModel is { id: string }.
getUsage(providerId)
ResourceUsage — the Agents referencing this Provider. agentCount is the real total;
agents is a preview capped at 20 entries. Check this before delete() to avoid a
blocked-delete error.
bulkDelete(ids)
Best-effort batch delete — partial failures (e.g. a Provider still referenced by an Agent) don’t throw or abort the rest of the batch.- Up to 100 ids per call — a request over that limit is rejected with a 400 before anything is deleted.
- Returns
{ deleted: string[], failed: { id, reason }[] }.