Skip to main content

Get API Docs

Page Outline

Returns the auto-generated OpenAPI specification for a model's inference endpoint, enabling clients to understand the expected input schema, output schema, and authentication requirements.

Base Path: /api/v1/models

Method: GET

Path: /{model_id}/api-docs

Auth: Requires a valid Bearer token (Authorization: Bearer <JWT>)

Path Parameters

ParameterTypeDescription
model_idstringUnique identifier of the model

Query Parameters

ParameterTypeDefaultDescription
version_idstringGenerate docs for a specific version. Defaults to the promoted version
formatstringjsonResponse format: json (OpenAPI 3.0 JSON) or yaml (OpenAPI 3.0 YAML)

Behavior

  • Generates an OpenAPI 3.0 specification scoped to the inference endpoint (/infer) for this specific model.
  • The requestBody schema is derived from the model's feature_columns and their data types, inferred from the linked dataset at training time.
  • The responses schema is derived from the model's task_type and output labels.
  • Returns HTTP 422 if the model has no promoted version and no schema to derive from.
  • Returns HTTP 404 if the model is not found.

Response

Returns an OpenAPI 3.0 specification document.

{
"openapi": "3.0.0",
"info": {
"title": "My Churn Predictor - Inference API",
"version": "3",
"description": "Auto-generated inference API for model mdl-7f3a19bc (version ver-001)."
},
"paths": {
"/infer": {
"post": {
"summary": "Run inference",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"age": { "type": "integer" },
"tenure": { "type": "integer" },
"monthly_spend": { "type": "number" },
"support_tickets": { "type": "integer" }
},
"required": ["age", "tenure", "monthly_spend"]
}
}
}
},
"responses": {
"200": {
"description": "Prediction result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prediction": { "type": "string", "enum": ["not_churned", "churned"] },
"probabilities": { "type": "object" }
}
}
}
}
}
}
}
}
}
}