---
title: "Get the AI Gateway key of a project"
method: GET
path: "/project/{project}/ai-gateway/keys/{key_id}"
tags: ["AIGateway"]
---

# Get the AI Gateway key of a project

`GET /project/{project}/ai-gateway/keys/{key_id}`

## Request

- Base URL: `https://api.aiven.io/v1`
- URL: `https://api.aiven.io/v1/project/{project}/ai-gateway/keys/{key_id}`
- Auth: HTTP bearer and OAuth 2
  - Authorization code: `https://console.aiven.io/oauth/authorize`
  - Token URL: `https://api.aiven.io/v1/oauth2/token` scopes: `projects:read`

> This endpoint **may be changed or removed at any time**. Don't use it in production environments.

Get key by id.

## Path parameters

- `project` string, required
- `key_id` string, required

## Response `200`

Response

- AIGatewayKeyGetResponse: AIGatewayKeyGetResponse
  - `key` object, required: AI Gateway key
    - `create_time` string, required: Time the key was created
    - `description` string: Longer description on how the key is used
    - `expiry_time` string: Time the key expires
    - `key_id` string, required: Key ID
    - `key_suffix` string, required: Last characters of the key
    - `name` string, required: Short human readable identifier for the key
    - `revocation_time` string: Time the key was revoked

## Other responses

- `403`: AI Gateway is not enabled for this organization
- `404`: Key not found
- `503`: AI Gateway keys are unavailable

## Changes

- **2026-10-14** `890113a87c87`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/aiven/apis/aiven-api-documentation/changes/project/:project/ai-gateway/keys/:key_id/get.md)

---

[API](https://skmtc.dev/aiven/apis/aiven-api-documentation.md) - [All operations](https://skmtc.dev/aiven/apis/aiven-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/aiven/apis/aiven-api-documentation/revisions/562453405db0?raw)
