---
title: "Get the given external key"
method: GET
path: "/workspaces/{workspace_id}/external_keys/{key_id}"
tags: ["External key"]
---

# Get the given external key

`GET /workspaces/{workspace_id}/external_keys/{key_id}`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/external_keys/{key_id}`
- 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`

Fetches information about an external_key, optionally returns validation info

## Path parameters

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

## Query parameters

- `fields` string: Fields to be returned in a comma-separated format. Check full mode for all fields.
- `validate` boolean, nullable: When True, Validates the key

## Response `200`

Success

- ExternalKeyResp
  - `external_key` 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.
  - `validation_info` ExternalKeyValidationInfo
    - `is_key_valid` boolean, required
    - `error_code` string, nullable
    - `error_message` string, nullable

## Other responses

- `400`: Bad request syntax or unsupported method
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help
- `404`: Nothing matches the given URI

---

[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/fe078afe239b?raw)
