---
title: "Add a model key"
method: PUT
path: "/growth/brain"
tags: ["RanlaCommands"]
---

# Add a model key

`PUT /growth/brain`

## Request

- Base URL: `https://api.supersendtx.com`
- URL: `https://api.supersendtx.com/growth/brain`
- Auth: HTTP bearer

Tests the key with one tiny call on the provider, then saves it
encrypted and makes it the one Ranla thinks with. Model calls on it are
billed by the provider and take no credits. On a dashboard session only
the workspace owner can add a key.

## Request body

- object
  - `provider` 'openrouter' | 'anthropic' | 'openai' | 'google', required
  - `apiKey` string, required

## Response `200`

Saved

- object
  - `brain` RanlaBrain, required
    - `choice` 'included' | 'openrouter' | 'anthropic' | 'openai' | 'google', required
    - `fallbackToIncluded` boolean, required
    - `keys` object[], required
      - `provider` 'openrouter' | 'anthropic' | 'openai' | 'google', required
      - `hint` string, required: The key's last four characters. The key itself is never returned.
      - `addedAt` string, date-time, required
      - `lastOkAt` string, date-time, nullable
      - `failure` object, nullable
        - `kind` 'invalid' | 'no_credit' | 'rate_limited' | 'no_model'
        - `since` string, date-time
        - `retryAt` string, date-time, nullable

## Other responses

- `400`: Unknown provider or no key
- `403`: Only the workspace owner can add a key
- `422`: The key failed its test call (not valid, no credit, rate limited, or no access to the model)

---

[API](https://skmtc.dev/ranla/apis/supersend-tx-api.md) · [All operations](https://skmtc.dev/ranla/apis/supersend-tx-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ranla/apis/supersend-tx-api/revisions/e3e782652f50?raw)
