STOCKFISH 14–19Latest release: 19Explore engines ↗

Documentation / API reference

POST /v1/auth/device/token

Poll with the private device_code from startAgentLogin. After owner approval, one exchange returns a 30-day scoped API key as access_token. Save it securely; it cannot be fetched again. No refresh token. Ordinary REST and MCP Bearer authentication then applies. Owner approval is required again after expiry; revoke keys in the dashboard. JSON device-login protocol, not automatic MCP OAuth discovery.

Auth
none required

Request body

FieldTypeDefaultNotes
device_code *string
curl -s https://stockfishapi.com/v1/auth/device/token \
  -H "Content-Type: application/json" \
  -d '{"device_code":"REPLACE_WITH_PRIVATE_DEVICE_CODE"}'
const res = await fetch("https://stockfishapi.com/v1/auth/device/token", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "device_code": "REPLACE_WITH_PRIVATE_DEVICE_CODE"
  }),
});
const data = await res.json();
import requests

r = requests.post(
    "https://stockfishapi.com/v1/auth/device/token",
    json={
        "device_code": "REPLACE_WITH_PRIVATE_DEVICE_CODE"
    },
)
data = r.json()

Responses

StatusMeaning
200Key returned once
400authorization_pending: continue polling; access_denied, expired_token or invalid_grant: stop. Malformed input can return problem+json.
409Account has ten keys; ask the owner to revoke an unused key, then retry if the code has not expired
429slow_down or rate-limit problem; honor Retry-After

Errors follow problem+json with next_action.