---
title: "Check a stored key with one tiny request"
method: POST
path: "/api/v1/model-keys/{id}/test"
tags: ["model-gateway"]
---

# Check a stored key with one tiny request

`POST /api/v1/model-keys/{id}/test`

## Request

- Base URL: `https://worthune.com`
- URL: `https://worthune.com/api/v1/model-keys/{id}/test`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`

Spends a few tokens on your provider account (counted under the "test" role). Provider errors come back with any key fragment removed.

## Request body

- object
  - `model` string, required

## Response `200`

The provider answered.

- object
  - `ok` unknown, required
  - `provider` string, required
  - `model` string, required
  - `latencyMs` integer, required
  - `reply` string, required
  - `usage` object, required
    - `inputTokens` integer, required
    - `outputTokens` integer, required

## Other responses

- `400`: Malformed JSON, a body of the wrong shape, or a top-level field that fails its check.
- `401`: No key presented (Authorization: Bearer wk_… or X-Api-Key).
- `402`: Unrecognized or revoked API key.
- `403`: The key's role is below the operation's floor (viewer < developer < owner), the key predates organization support, or the plan lacks the feature. On a sandbox key, also: the cap of 5 active households on create and import, the cap of 1 active Lodestar mandate, and the white-label surfaces (tenant config, embed tokens) and narration or mapping drafts on Worthune's model (they run on your own: a model assigned at /api/v1/model-policy, or x-model-key), which the sandbox does not carry.
- `404`: No such key in your organization.
- `422`: Invalid model id, or the key's endpoint is no longer allowed.
- `429`: Hourly per-org stateful quota, a per-route durable limit, or the 120 requests/minute per-IP burst backstop.
- `502`: The provider refused or did not answer; the message carries its reason.
- `503`: Billing is not configured on this deployment; household resources are disabled rather than served without tenancy (production fail-closed).

---

[API](https://skmtc.dev/worthune/apis/worthune-api.md) · [All operations](https://skmtc.dev/worthune/apis/worthune-api/llms.txt) · [OpenAPI document](https://skmtc.dev/worthune/apis/worthune-api/revisions/9f2241072555?raw)
