SnozeDevelopers
API referenceModel sources

Check a provider API key before saving it

Calls the provider with the candidate key and returns whether it was accepted along with the model catalog it exposes, without storing anything. Because it performs a network call on the caller's behalf, it is gated on being able to list the workspace's model sources (`models:read`). A key the provider rejects comes back as `valid: false` rather than as an error.

POST
/v1/workspaces/{workspaceId}/model-sources/validate-key

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

Path Parameters

workspaceId*string

Request Body

application/json
  1. body
kind*
key*

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.snoze.dev/v1/workspaces/string/model-sources/validate-key' \  -H 'Content-Type: application/json' \  -d '{  "kind": "openrouter",  "key": {    "apiKey": "string"  }}'
Example Response
{  "data": {    "valid": true,    "models": [      {        "id": "string",        "label": "string",        "description": "string",        "contextLength": 0,        "pricing": {          "prompt": "string",          "completion": "string",          "inputCacheRead": "string",          "inputCacheWrite": "string",          "request": "string",          "tiers": [            {              "minPromptTokens": 0,              "prompt": "string",              "completion": "string",              "inputCacheRead": "string",              "inputCacheWrite": "string"            }          ]        },        "metadata": {          "inputModalities": [            "string"          ],          "outputModalities": [            "string"          ],          "supportedParameters": [            "string"          ],          "reasoning": {            "mandatory": true,            "supportedEfforts": [              "string"            ],            "defaultEffort": "string",            "defaultEnabled": true          },          "contextLength": 0,          "maxOutputTokens": 0,          "pricing": {            "prompt": "string",            "completion": "string",            "inputCacheRead": "string",            "inputCacheWrite": "string",            "request": "string",            "tiers": [              {                "minPromptTokens": 0,                "prompt": "string",                "completion": "string",                "inputCacheRead": "string",                "inputCacheWrite": "string"              }            ]          },          "created": 0,          "expirationDate": "string",          "canonicalSlug": "string"        }      }    ]  }}