---
title: "Get API Key"
method: GET
path: "/v4/organizations/{organizationId}/aiServices/models/apiKeys/{apiKeyId}"
tags: ["Model Services API Keys (AI Data Plane)"]
---

# Get API Key

`GET /v4/organizations/{organizationId}/aiServices/models/apiKeys/{apiKeyId}`

Returns an API Key for the given region in the organization by its ID.

In order to access this endpoint, the provided API key must have at least one of the following roles:
 - Organization Owner

To learn more, see [Organization, Project, and Database Access Overview](https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html).

## Response `200`

Successfully retrieved the API Key.

- GetLanguageModelAPIKeyResponse
  - `keyId` string — Unique identifier for the Language Model API key
  - `name` string — Name of the Language Model API key
  - `description` string — Description of the Language Model API Key
  - `expiry` number, float — Expiry of the API key in number of days. Maximum value is 365 days.
  - `allowedCIDRs` string[] — List of IP addresses or CIDR blocks that are allowed to use this API key.
  - `allowedModels` object[] — List of allowed models for this API key. Returns "*" if all models in the region are allowed, or specific model IDs if restricted.
    - `id` string, required — Unique identifier for the model
    - `name` string, required — Name of the model
  - `region` string — The region where the API key will be created. The apikey created in a region can access all the models available in that region.
  - `audit` CouchbaseAuditData
    - `createdBy` string, required — The user who created the resource; this will be a UUID4 ID for standard users and will be a string such as "internal-support" for internal Couchbase support users.
    - `createdAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was initially created.
    - `modifiedBy` string, required — The user who last modified the resource; this will be a UUID4 ID for standard users and will be a string such as "internal-support" for internal Couchbase support users.
    - `modifiedAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was last modified.
    - `version` integer, required — The version of the document. This value is incremented each time the resource is modified.

## Other responses

- `400` — Returned when we are unable to decode the recevied payload.
- `401` — The client does not have the valid credentials to access this resource.
- `403` — The client does not have the necessary permissions to access this resource.
- `404` — The requested resource was not found.
- `422` — Request validation error.
- `429` — Returned when the client exceeds the rate limit for the given APIKey.
- `500` — An unexpected error occurred in the server while processing this request.

---

[API](https://skmtc.dev/couchbase/apis/couchbase-capella-management-api.md) · [All operations](https://skmtc.dev/couchbase/apis/couchbase-capella-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/couchbase/couchbase-capella-management-api/revisions/8a095fcfed91/schema)
