---
title: "Get AI Model spec"
method: GET
path: "/v1/ai-models/{aiModelId}/spec"
tags: ["Catalog AI Model Specs"]
---

# Get AI Model spec

`GET /v1/ai-models/{aiModelId}/spec`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v1/ai-models/{aiModelId}/spec`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Convenience shortcut to the `latest` version's oas specification. Returns `404`  if either the version or the specification is missing, distinguished by error code in the response body (`ai_model_version_not_found` / `ai_model_spec_not_found`).

## Path parameters

- `aiModelId` string, uuid, required

## Response `200`

The latest version's spec

- AiModelVersionSpec: The oas specification document for an AI Model version.
  - `spec_content` string, required: The raw content of the oas specification, in json or yaml format (for example, an OpenAPI document).
  - `spec_type` 'oas', required: The type of specification document. Currently always `oas` (OpenAPI Specification).
  - `spec_provider` object, nullable: Provenance of the specification. `null` (or absent) for a user-uploaded specification.
    - `source` 'ai_gateway' | 'provider', required
  - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

## Changes

- **2026-11-16** `a209c8bfa7b7`: 2 info
  - the `spec_type` response property const value `oas` was added for the status `200`
  - removed the `oas` enum value from the `spec_type` response property for the response status `200`
- **2026-11-12** `d8bd04cfbaf7`: 1 breaking, 1 warning
  - the `spec_type` response property const value `oas` was removed for the status `200`
  - added the new `oas` enum value to the `spec_type` response property for the response status `200`
- **2026-10-07** `59663dd13a10`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api-go-sdk/changes/v1/ai-models/:aiModelId/spec/get.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-go-sdk.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api-go-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/3b071797f6e4?raw)
