Skip to content

Credentials

12 calls. Every request needs the Authorization header: see the overview.

DELETE /credentials

Deletes every credential with this tag (and takes them out of their stacks), and returns how many it deleted.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Query parameters

NameTypeRequiredDescription
tagstringyes

Response: integer (200)

curl -X DELETE "https://api.maitento.com/credentials" \
-H "Authorization: $MAITENTO_AUTH"
GET /credentials

Every credential of the tenant, by name; with tag, only those with that tag.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Query parameters

NameTypeRequiredDescription
tagstring

Response: ModelCredential[] (200)

curl -X GET "https://api.maitento.com/credentials" \
-H "Authorization: $MAITENTO_AUTH"
POST /credentials

Creates an API-key credential and returns it, with its id. Refused with ValidationError when the name is taken, a key or the endpoint is invalid, or the plan’s credential limit is reached.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: ModelCredentialRequest

FieldTypeRequiredDescription
namestring
descriptionstring | null
providerModelKeyProvider
endpointstring | nullAn HTTPS endpoint on the public internet; null for the provider’s public API.
cloudCredentialCloudInput| nullFor an Anthropic credential: Claude on Amazon Bedrock (with awsRegion) or Google Vertex AI (with gcpProjectId and gcpRegion), with no endpoint. The key is then the Bedrock API key, or the service account’s JSON key file. Only code pipelines’ Claude Code agents run on it.
keysModelCredentialKeyRequest[]
modelsCredentialModelInput[]
tagstring | null

Response: ModelCredential (200)

curl -X POST "https://api.maitento.com/credentials" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"name":"...","description":"...","provider":"Anthropic","endpoint":"...","cloud":{},"keys":[],"models":[],"tag":"..."}'
DELETE /credentials/by-id/{id}

Deletes a credential and takes it out of every stack that holds it.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Response: no body (204)

curl -X DELETE "https://api.maitento.com/credentials/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH"
GET /credentials/by-id/{id}

The credential with this id. Throws NotFoundError when there is none.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Response: ModelCredential (200)

curl -X GET "https://api.maitento.com/credentials/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH"
PUT /credentials/by-id/{id}

Replaces a credential’s fields. Keys are matched by id: one sent as { id } keeps its secret, and one left out is removed. New keys or a new endpoint switch a credential its circuit breaker turned off back on.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: ModelCredentialRequest

FieldTypeRequiredDescription
namestring
descriptionstring | null
providerModelKeyProvider
endpointstring | nullAn HTTPS endpoint on the public internet; null for the provider’s public API.
cloudCredentialCloudInput| nullFor an Anthropic credential: Claude on Amazon Bedrock (with awsRegion) or Google Vertex AI (with gcpProjectId and gcpRegion), with no endpoint. The key is then the Bedrock API key, or the service account’s JSON key file. Only code pipelines’ Claude Code agents run on it.
keysModelCredentialKeyRequest[]
modelsCredentialModelInput[]
tagstring | null

Response: ModelCredential (200)

curl -X PUT "https://api.maitento.com/credentials/by-id/<id>" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"name":"...","description":"...","provider":"Anthropic","endpoint":"...","cloud":{},"keys":[],"models":[],"tag":"..."}'
PUT /credentials/by-id/{id}/sign-in-tokens

Replaces the tokens of a credential made by importSignIn, after you refreshed them. A sign-in made through startSignIn is refused with api:credentials:sign-in-refreshed-here: Maitento refreshes those itself.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Request body: CredentialSignInTokensRequest

FieldTypeRequiredDescription
toolCredentialOAuthToolThe coding agent the sign-in is for.
accessTokenstringThe access token. Write-only.
refreshTokenstringThe refresh token, which the coding agent may need during a long run. Write-only.
idTokenstring | nullThe OpenID Connect ID token. Required for Codex; null for Claude. Write-only.
expiresAtUtcdatetimeWhen the access token expires (UTC).
scopesstring[] | nullThe scopes the tokens carry.
subscriptionTypestring | nullThe subscription the sign-in belongs to, as the provider names it (for example max).
accountNamestring | nullWho signed in, as the provider shows it.
namestring | null
descriptionstring | null
tagstring | null
keepFreshbooleanTrue: the platform keeps these tokens fresh from now on, with the refresh token, as it does for a sign-in made here. Stop refreshing them yourself: a refresh replaces the refresh token, so only one side can keep doing it. Replacing the tokens of a sign-in you’ve been refreshing with this set hands it over. Once handed over it can’t be handed back; sign in again for new tokens. False (default): you keep them fresh.

Response: ModelCredential (200)

curl -X PUT "https://api.maitento.com/credentials/by-id/<id>/sign-in-tokens" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"tool":"Claude","accessToken":"...","refreshToken":"...","idToken":"...","expiresAtUtc":"2026-01-01T00:00:00Z","scopes":[],"subscriptionType":"...","accountName":"...","name":"...","description":"...","tag":"...","keepFresh":false}'
POST /credentials/by-id/{id}/test

Tests a credential without running a model: each key lists the provider’s models once at the credential’s endpoint. The test passes when every key does, and a passing test switches a credential its circuit breaker turned off back on. Limited to a few a minute per tenant: beyond that it throws RateLimitError.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
iduuidyes

Response: CredentialTestResult (200)

curl -X POST "https://api.maitento.com/credentials/by-id/<id>/test" \
-H "Authorization: $MAITENTO_AUTH"
POST /credentials/sign-in-tokens

Makes an OAuth credential from a sign-in whose tokens you already hold, such as one your own application signed in. You keep them fresh: Maitento never refreshes them, so call replaceSignInTokens each time you refresh. Tenant admins only. Never retried: a retry could make a second credential.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: CredentialSignInTokensRequest

FieldTypeRequiredDescription
toolCredentialOAuthToolThe coding agent the sign-in is for.
accessTokenstringThe access token. Write-only.
refreshTokenstringThe refresh token, which the coding agent may need during a long run. Write-only.
idTokenstring | nullThe OpenID Connect ID token. Required for Codex; null for Claude. Write-only.
expiresAtUtcdatetimeWhen the access token expires (UTC).
scopesstring[] | nullThe scopes the tokens carry.
subscriptionTypestring | nullThe subscription the sign-in belongs to, as the provider names it (for example max).
accountNamestring | nullWho signed in, as the provider shows it.
namestring | null
descriptionstring | null
tagstring | null
keepFreshbooleanTrue: the platform keeps these tokens fresh from now on, with the refresh token, as it does for a sign-in made here. Stop refreshing them yourself: a refresh replaces the refresh token, so only one side can keep doing it. Replacing the tokens of a sign-in you’ve been refreshing with this set hands it over. Once handed over it can’t be handed back; sign in again for new tokens. False (default): you keep them fresh.

Response: ModelCredential (200)

curl -X POST "https://api.maitento.com/credentials/sign-in-tokens" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"tool":"Claude","accessToken":"...","refreshToken":"...","idToken":"...","expiresAtUtc":"2026-01-01T00:00:00Z","scopes":[],"subscriptionType":"...","accountName":"...","name":"...","description":"...","tag":"...","keepFresh":false}'
POST /credentials/sign-in/{tool}

Starts signing a coding agent’s subscription in as an OAuth credential: "Claude" (Claude Code, on a Claude Pro or Max subscription) or "Codex" (on a ChatGPT subscription). Pass { credentialId } to sign an existing one in again (new tokens, same credential and stacks). Code pipelines run their agents on such a credential in place of an API key. Signing in takes two steps. For Claude, the person opens authorizeUrl, signs in, and you pass the code Anthropic shows to finishSignIn. For Codex, the person opens verificationUrl and enters userCode, and you call finishSignIn every pollIntervalSeconds until it returns Complete. Either way, finish before expiresAtUtc.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
toolCredentialOAuthToolyes

Request body: CredentialSignInStartRequest

FieldTypeRequiredDescription
credentialIduuid | nullTo sign an existing OAuth credential in again (new tokens, same credential and stacks); null for a new one.

Response: CredentialSignInStart (200)

curl -X POST "https://api.maitento.com/credentials/sign-in/<tool>" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"credentialId":"..."}'
POST /credentials/sign-in/{tool}/finish

Finishes a sign-in that startSignIn started. For Claude, pass the code Anthropic showed (as shown, # and all). For Codex, pass no code and call again every pollIntervalSeconds while it returns Pending. Once it returns Complete, credential is the saved credential; name, description and tag name a new one (a credential signed in again keeps its own).

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Path parameters

NameTypeRequiredDescription
toolCredentialOAuthToolyes

Request body: CredentialSignInFinishRequest

FieldTypeRequiredDescription
signInIduuid
codestring | nullThe code Anthropic shows after signing in to Claude (as shown, code#state included).
namestring | null
descriptionstring | null
tagstring | null

Response: CredentialSignInResult (200)

curl -X POST "https://api.maitento.com/credentials/sign-in/<tool>/finish" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"signInId":"...","code":"...","name":"...","description":"...","tag":"..."}'
POST /credentials/test

Tests a credential before saving it, so a failing one never has to exist: the same checks and calls as test, on the keys in request (what create takes). Nothing is stored, and the result’s credentialId is empty. Refused with create’s codes, and shares test’s limit.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: ModelCredentialRequest

FieldTypeRequiredDescription
namestring
descriptionstring | null
providerModelKeyProvider
endpointstring | nullAn HTTPS endpoint on the public internet; null for the provider’s public API.
cloudCredentialCloudInput| nullFor an Anthropic credential: Claude on Amazon Bedrock (with awsRegion) or Google Vertex AI (with gcpProjectId and gcpRegion), with no endpoint. The key is then the Bedrock API key, or the service account’s JSON key file. Only code pipelines’ Claude Code agents run on it.
keysModelCredentialKeyRequest[]
modelsCredentialModelInput[]
tagstring | null

Response: CredentialTestResult (200)

curl -X POST "https://api.maitento.com/credentials/test" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"name":"...","description":"...","provider":"Anthropic","endpoint":"...","cloud":{},"keys":[],"models":[],"tag":"..."}'