Skip to content
Alphahelmstudio is early software: things will change, and some will break.What's newReport an issue

Save a provider's key — checked with the provider, then written to the key file (never read back)

PUT
/v1/studio/admin/provider-keys/{key_secret}
curl --request PUT \
--url http://localhost:8300/v1/studio/admin/provider-keys/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "key": "example", "preset": "example", "provider": "example", "force": false }'

. Admin only (403). The body names one source, as Fetch does: preset (studio takes its kind, base_url and compat from the presets file) or provider (a saved provider’s row); never a URL from the browser (a base_url is 422). Studio asks pipelines.providers.key.write (30 s, else 503): pipelines lists GET <base_url>/models with the key in memory (the host rule and the remote switch as for any call, 15 s), and check is ok (written), refused (401 or 403: nothing written), unreachable (anything else: nothing written; detail is our own short reason) or skipped (force: true: written without a call). The key is trimmed, then 1-1024 printable ASCII characters only (0x21-0x7E: no spaces, no …, curly quote, non-breaking or zero-width space), written into the first key folder only (temp file and rename, owner-only) and never returned or logged. 404 malformed name, unknown preset or provider; 422 a bad key (the detail names the rule, never the value; a character outside 0x21-0x7E is always the key has a character keys never have (like … or a curly quote): copy it again from the provider), both or neither source, an unknown field; 409 keys are set in files on this deployment (not writable) or a folder of that name.

key_secret
required
string
Media typeapplication/json
One of:

: a key to check and save. Exactly one source: preset or provider (never a URL)

object
key

The key; trimmed, then 1-1024 printable ASCII characters only (0x21-0x7E, no spaces; anything else is 422 with a fixed text, never the key or the character). Never returned, logged or stored outside the key file

string
>= 1 characters <= 1024 characters /^\s*[!-~]+\s*$/
preset
required

Check with this preset’s URL

string
/^[a-z][a-z0-9-]{0,31}$/
provider

Check with this saved provider’s URL

string
/^[a-z][a-z0-9-]{0,31}$/
force

Save anyway: write without a check (check skipped)

boolean

The check and the status after it

Media typeapplication/json

The check’s verdict and the key file’s status after it (never the key)

object
key_secret
required
string
path
required
string
found
required
boolean
saved
required

Written: true for check ok and skipped

boolean
check
required

Ok: /models answered; refused: 401 or 403; unreachable: anything else (network, timeout, 429, 5xx, another 4xx, the host rule, remote models off); skipped: force

Allowed values: ok refused unreachable skipped
detail

Refused or unreachable: our own short text, never the provider’s

string
<= 300 characters

Example

{
"path": "deploy/secrets/providers/deepseek",
"check": "ok"
}

Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Valid token without the admin role: “admin role required”

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Not found

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

The resource’s state forbids this

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Invalid input

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Retryable

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}