---
title: "Get external keys of the given Workspace ID"
method: GET
path: "/workspaces/{workspace_id}/external_keys"
tags: ["External keys"]
---

# Get external keys of the given Workspace ID

`GET /workspaces/{workspace_id}/external_keys`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/external_keys`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

This endpoint fetches all external keys added as part of the given Workspace ID

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Query parameters

- `fields` string: Fields to be returned in a comma-separated format. Check full mode for all fields.
- `limit` integer: Max number of result to return
- `offset` integer: Distance from the beginning of the list of results
- `sort` string: Returned results are sorted by the combination of the given fields.
- `key_type` 'open_ai' | 'anthropic' | 'gemini' | 'grok': Type of the external key e.g. open_ai

## Response `200`

Success

- ExternalKeysPaginated
  - `limit` integer: Setting limit would limit the items received in the page
  - `offset` integer: First position to return from the results
  - `next` string, required: Url of the next page
  - `external_keys` ExternalKey[], required
    - `id` integer, nullable: ID of the external key as saved in the DB
    - `key_type` 'open_ai' | 'anthropic' | 'gemini' | 'grok', nullable: Type of the external key e.g. open_ai
    - `key_name` string, nullable: A name to be associated with the key
    - `description` string, nullable: Describe the purpose of the key and any added information related to it
    - `secure_key` string, nullable: The key value which will be used in the intended service
    - `is_in_use` boolean, nullable: Is the key currently in use?
    - `model_id` string, nullable: The specific LLM model bound to this key e.g. claude-haiku-4-5
    - `model_config_data` ModelConfigSpec
      - `thinking_budget` integer, nullable: Maximum thinking tokens (Anthropic/Gemini models). Use -1 for Gemini dynamic mode.
      - `thinking_level` string, nullable: Thinking level: minimal, low, medium, high (Gemini v3 models; minimal is Flash-only).
      - `reasoning_effort` string, nullable: Reasoning effort: low, high (Grok reasoning models).
      - `web_search` boolean, nullable: Enable live web search grounding (supported models only).
      - `cached_input` boolean, nullable: Enable prompt caching for repeated input prefixes to reduce cost (supported models only).
    - `created_by_user_id` integer, nullable: ID of the user that created this key
    - `last_used_at` string, date-time, nullable: When was the key last used at?
    - `last_used_by_used_id` integer, nullable: ID of the user who the key in the recent most usage?
    - `created_at` string, date-time, nullable: When was the key created? Null for keys created before this was recorded.
  - `providers` object[], nullable: Available LLM providers with their models and config capabilities. Only included when fields=__full.
  - `house_keys` HouseKey[]: Mammoth-owned house keys available as a fallback for GenAI requests with no pinned api_key_id. Currently always a single open_ai entry, since the house key is OpenAI-only. is_in_use on this list and on external_keys are mutually exclusive per key_type — exactly one is True at a time.
    - `key_type` 'open_ai' | 'anthropic' | 'gemini' | 'grok', required: Type of the external key e.g. open_ai
    - `is_in_use` boolean, required: Whether a GenAI request with no pinned api_key_id would use this house key (True), because the workspace has no in-use key of this key_type of its own, or the workspace's own key (False).

## Other responses

- `400`: Bad request syntax or unsupported method
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
