Home / Docs / API reference

/v1/models

GET /v1/models

Authentication relay key (bearer)

Example request

curl
curl https://api.massrelay.ai/v1/models \
  -H "Authorization: Bearer $RELAY_KEY"
Python
import os, requests

r = requests.get(
    "https://api.massrelay.ai/v1/models",
    headers={"Authorization": f"Bearer {os.environ['RELAY_KEY']}"},
)
r.raise_for_status()
print(r.json())
TypeScript
const r = await fetch("https://api.massrelay.ai/v1/models", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.RELAY_KEY}` },
});
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
console.log(await r.json());

Response

FieldTypeDescription
object requiredstringThe kind of object returned, for example chat.completion. Always "list".
data requiredarray of objectThe list of items returned.
data[].id requiredstringA model id, or an alias name (after the models).
data[].object requiredstringThe kind of object returned, for example chat.completion. Always "model".
data[].massrelayobject
data[].massrelay.providerstring
data[].massrelay.custodystring
data[].massrelay.familystring
data[].massrelay.reasoning_optionsobject
data[].massrelay.price_bandsarray
data[].massrelay.ownedBystringPresent only for the workspace's own model. Always "workspace".
data[].massrelay.inputUsdPerMnumber
data[].massrelay.outputUsdPerMnumber
data[].massrelay.aliasbooleanPresent on an alias entry. Always true.
data[].massrelay.startTierobject
data[].massrelay.preferOwnModelsboolean
Example response (shape)
{
  "object": "list",
  "data": [
    {
      "id": "<id>",
      "object": "model",
      "massrelay": {
        "provider": "<provider>",
        "custody": "<custody>",
        "family": "<family>",
        "reasoning_options": "<reasoning_options>",
        "price_bands": [],
        "ownedBy": "workspace",
        "inputUsdPerM": 0,
        "outputUsdPerM": 0,
        "alias": true,
        "startTier": "<startTier>",
        "preferOwnModels": false
      }
    }
  ]
}

Common errors

  • 401 invalid_api_key
  • 403 insufficient_scope
  • 429 over the request rate; read Retry-After

Every error has the same JSON shape; see Errors and Limits.

Full schema (JSON)

Response schema

{
  "description": "Served for an L1 key; any other key layer answers 501 not_ported. The massrelay keys listed are those the handler inserts; a key appears only when its source row exists.",
  "type": "object",
  "required": [
    "object",
    "data"
  ],
  "properties": {
    "object": {
      "const": "list"
    },
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "object"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "A model id, or an alias name (after the models)."
          },
          "object": {
            "const": "model"
          },
          "massrelay": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "provider": {
                "type": "string"
              },
              "custody": {
                "type": "string"
              },
              "family": {
                "type": "string"
              },
              "reasoning_options": {},
              "price_bands": {
                "type": "array"
              },
              "ownedBy": {
                "const": "workspace",
                "description": "Present only for the workspace's own model."
              },
              "inputUsdPerM": {
                "type": "number"
              },
              "outputUsdPerM": {
                "type": "number"
              },
              "alias": {
                "const": true,
                "description": "Present on an alias entry."
              },
              "startTier": {},
              "preferOwnModels": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}