Everstack

Add Provider APIKey adds a new API key to a provider configuration

POST/v1/providers/api-keys
POST/v1/providers/api-keys

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Request Body

PropertyTypeRequiredDescription
providerConfigIdstringNo
keyNamestringNo
apiKeystringNo
weightintegerNo

Responses

200 API key added successfully

PropertyTypeDescription
keyobject

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/v1/providers/api-keys" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"providerConfigId":"string","keyName":"string","apiKey":"string","weight":0}'
const response = await fetch("http://localhost:8089/v1/providers/api-keys", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "providerConfigId": "string",
  "keyName": "string",
  "apiKey": "string",
  "weight": 0
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/v1/providers/api-keys",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "providerConfigId": "string",
  "keyName": "string",
  "apiKey": "string",
  "weight": 0
},
)
data = response.json()

Response

{
  "key": {
    "id": "string",
    "providerConfigId": "string",
    "keyName": "string",
    "keyMasked": "string",
    "weight": 0,
    "isActive": true,
    "createdAt": "string",
    "updatedAt": "string",
    "source": "string"
  }
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}