diff --git a/api-reference/ai/models.mdx b/api-reference/ai/models.mdx new file mode 100644 index 0000000..6bd25e0 --- /dev/null +++ b/api-reference/ai/models.mdx @@ -0,0 +1,4 @@ +--- +title: 'List Models' +openapi: '/api-reference/openapi/ai.json GET /api/ai/models' +--- diff --git a/api-reference/openapi/ai.json b/api-reference/openapi/ai.json new file mode 100644 index 0000000..f579519 --- /dev/null +++ b/api-reference/openapi/ai.json @@ -0,0 +1,122 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Recoup API - AI", + "description": "API documentation for the Recoup platform - an AI agent platform for the music industry", + "license": { + "name": "MIT" + }, + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://recoup-api.vercel.app" + } + ], + "paths": { + "/api/ai/models": { + "get": { + "description": "Returns the catalog of language models available through the Vercel AI Gateway. Embedding models are filtered out. The full schema mirrors the Vercel AI Gateway response (`GatewayLanguageModelEntry` from `@ai-sdk/gateway`); the documented properties below are the load-bearing fields used by clients. No authentication required.", + "responses": { + "200": { + "description": "Model catalog retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AIModelsResponse" + } + } + } + }, + "500": { + "description": "Internal server error - failed to fetch models from the gateway", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AIModelsErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AIModelsResponse": { + "type": "object", + "required": [ + "models" + ], + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GatewayLanguageModelEntry" + }, + "description": "List of language models available through the Vercel AI Gateway" + } + } + }, + "GatewayLanguageModelEntry": { + "type": "object", + "additionalProperties": true, + "description": "A language model entry as returned by the Vercel AI Gateway. Full schema mirrors the upstream `GatewayLanguageModelEntry` type from `@ai-sdk/gateway`.", + "properties": { + "id": { + "type": "string", + "description": "Fully qualified model identifier (e.g., 'anthropic/claude-3-5-sonnet')", + "example": "anthropic/claude-3-5-sonnet" + }, + "name": { + "type": "string", + "description": "Human-readable display name for the model", + "example": "Claude 3.5 Sonnet" + }, + "description": { + "type": "string", + "description": "Provider-supplied description of the model" + }, + "modelType": { + "type": "string", + "description": "Type of model - embedding models are filtered out before the response is returned", + "example": "language" + }, + "pricing": { + "type": "object", + "additionalProperties": true, + "description": "Per-token pricing information as reported by the gateway", + "properties": { + "input": { + "type": "string", + "description": "Cost per input token (USD)" + }, + "output": { + "type": "string", + "description": "Cost per output token (USD)" + } + } + }, + "specification": { + "type": "object", + "additionalProperties": true, + "description": "Model specification metadata (provider, version, capabilities). Shape mirrors the gateway response." + } + } + }, + "AIModelsErrorResponse": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string", + "description": "Error message describing what went wrong" + } + } + } + } + } +} diff --git a/docs.json b/docs.json index c339033..0ea3137 100644 --- a/docs.json +++ b/docs.json @@ -342,6 +342,12 @@ "pages": [ "api-reference/notifications/create" ] + }, + { + "group": "AI", + "pages": [ + "api-reference/ai/models" + ] } ] }