Store or replace a vendor credential
Stores the credential for one provider, replacing any credential stored for it before. Meadow first makes one cheap read call to the vendor to check the credential. A credential the vendor rejects is not saved and the call returns 400. If the vendor cannot be reached the call returns 502, and you can retry.
credentials depends on the provider:
Rules:
- A field that is not in the table returns 400.
azure:endpointis the barehttpsorigin of your Azure OpenAI resource.deploymentsmaps a Meadow model id to your deployment name and must not be empty. It decides which unpinned models route to Azure. A model id writtenazure/<deployment>is sent to that deployment as written. Leaveapi_versionout to use Azure’s v1 API, which takes noapi-version. Send it to use the dated API. One credential holds one resource and one deployment per model.deployment_typesmaps a deployment name to Azure’s deployment type code (GlobalStandard,DataZoneStandard,Standard,GlobalProvisionedManaged,DataZoneProvisionedManaged,ProvisionedManaged,GlobalBatch,DataZoneBatch,DeveloperTier). Calls are priced only on aGlobalStandarddeployment; another type, or none, leaves the call with no cost.bedrock: an IAM user access key, or a Bedrock API key inapi_key(not both).regionis a standard AWS region name such asus-east-1. Sendsession_tokenwith temporary credentials from STS. Withapi_key, Meadow calls Bedrock’s Anthropic Messages route (/anthropic/v1/messages) and does not check the key with AWS before storing it.inference_profileisglobal(the default),us,euornone, and decides where AWS may process a call: see Bedrock under Models.usneeds aus-region andeuaneu-region, or the call returns 400.vertex:service_account_jsonis the service account key, as a JSON object or as a string holding it.projectis the project whose Vertex AI serves the calls.regionisglobal, the multi-regionsusoreu, or one region such asus-east5. Thetoken_uriinside the key is ignored. The service account needsaiplatform.endpoints.predictonproject(the Vertex AI User role has it), or the call returns 400.- The check at store time does not prove that a model call will work. Azure’s check lists models and Bedrock’s asks AWS who the key is. Both pass for an account that may not invoke models. Make one small call after you store a credential.
openrouter: store an inference key. A management key returns 400.fireworks: the check isGET https://api.fireworks.ai/v1/accounts.deepseek: the check isGET https://api.deepseek.com/models.anthropic: a Claude Code login token is accepted asapi_key.project_idslimits the credential to those projects. Left out ornullmeans every project. Always send it for a credential that should be scoped. An id that does not exist returns 404.- After a Modal credential is replaced or deleted, the old token can stay in use for up to 5 minutes.
Scope: admin.
Authentication
A Meadow API key, sent as Authorization: Bearer mdw_.... The header
x-api-key: mdw_... is accepted in its place.
Path parameters
Request
The vendor credential. Its fields depend on the provider.
anthropic,openai,google,xai,openrouter,fireworks,deepseek:{api_key}.azure:{api_key, endpoint, deployments}, and optionallyapi_versionanddeployment_types(deployment name to Azure’s deployment type code, such asGlobalStandard; only aGlobalStandarddeployment is priced).endpointis the bare resource origin, such ashttps://<resource>.openai.azure.com.deploymentsmaps a Meadow model id to your deployment name. It decides which unpinned models route to Azure.azure/<deployment>sends an unmapped name as written. Withoutapi_versionMeadow calls Azure’s v1 API (/openai/v1/chat/completions,/openai/v1/responses) with the deployment name asmodel. Withapi_versionit calls the dated API (/openai/deployments/<deployment>/chat/completionsand/openai/responses, both with?api-version=). One key holds one resource.bedrock:{access_key_id, secret_access_key, region}, and optionallysession_tokenandinference_profile. An IAM access key, signed with SigV4.regionis a standard AWS region name.session_tokenis for temporary credentials. Or{api_key, region}with an optionalinference_profile: a Bedrock API key, sent inx-api-keyto Bedrock’s Anthropic Messages route. A credential holds one of the two, not both.inference_profileis one ofglobal(the default),us,euornone. It sets the prefix of the Bedrock model id for models Meadow picks:global.anthropic.<model>,us.anthropic.<model>,eu.anthropic.<model>, oranthropic.<model>with no profile.usneeds aus-region (notus-gov-) andeuneeds aneu-region, or the write returns 400. A pinned id such asbedrock/us.anthropic.<model>is always sent as written.vertex:{service_account_json, project, region}.projectis the project whose Vertex AI serves the calls. It may differ from the service account’s own project when the account hasaiplatform.endpoints.predictthere.regionisglobal, the multi-regionsusoreu, or a single region such asus-east5. Thetoken_uriinsideservice_account_jsonis ignored.daytona:{api_key}, and optionallyorganization_id.modal:{token_id, token_secret}, and optionallyenvironment.
Any other field returns 400.
Each credential is checked when it is stored: one read call for the API key
providers and Azure (its model list), STS GetCallerIdentity for bedrock,
and for vertex a token exchange plus a check that the account has
aiplatform.endpoints.predict on project. A stored bedrock or azure
credential can still be refused at call time by an account that may not
invoke models.
Response headers
Meadow’s id for this request, req_ and 24 hex characters. Every response
carries it, including errors, streams and unknown routes. Every error in the
Error schema repeats it as request_id. Quote it when you report a problem.
Response
The name of a vendor. Model providers and sandbox providers share one list.
Model providers: anthropic, openai, google, xai, azure, bedrock,
vertex, openrouter, fireworks, deepseek. Sandbox providers: daytona, modal.
The last four characters of the stored key (for modal, of the token id).
What Meadow remembers about recent sandbox creates on this provider with this
account’s key. Present for daytona and modal only. It is a circuit breaker.
closed: the provider is tried in its usual place. open: it failed lately, so a
create with another provider in its route tries the other one first, until
retry_at. half_open: one create is trying it again, and that create’s result
closes it or opens it again. A provider opens after 3 failed creates in a row
within 10 minutes (timeout or vendor error), for 60 seconds, or after one quota,
capacity or rate limit answer, for 30 seconds. A rejected key (401 or 403) does
not count. An order the caller or the project set moves an open provider only
on a hard signal: a quota or capacity answer, or the 3 failures in a row. A
route with one provider is never reordered. Storing the key again clears it.