{
	"openapi": "3.1.0",
	"info": {
		"title": "Stogas Gateway API",
		"summary": "OpenAI-compatible public API gateway.",
		"description": "The Stogas Gateway exposes an OpenAI-compatible surface. Authenticate requests with your Stogas API key, and the gateway will relay the request to the configured upstream provider.",
		"version": "1.0.0"
	},
	"jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
	"servers": [
		{
			"url": "{serverUrl}",
			"description": "Gateway origin. Endpoint paths include their API version.",
			"variables": {
				"serverUrl": {
					"default": "https://api.stogas.ai"
				}
			}
		}
	],
	"paths": {
		"/v1/catalog": {
			"get": {
				"operationId": "getCatalog",
				"tags": [
					"Catalog"
				],
				"summary": "Catalog",
				"description": "Returns the active public gateway catalog used for model discovery, aliases, routing, and prices.",
				"security": [],
				"responses": {
					"200": {
						"description": "Active public catalog.",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/CatalogResponse"
								},
								"examples": {
									"catalog": {
										"value": {
											"version": "stogas.gateway.catalog.v1",
											"generatedAt": "1970-01-01T00:00:01Z",
											"graph": {
												"models": {},
												"deployments": {},
												"providers": {},
												"providerEndpoints": {},
												"stogasEndpoints": {}
											},
											"indexes": {
												"provider_endpoint_request_slugs": {}
											}
										}
									}
								}
							}
						}
					},
					"500": {
						"$ref": "#/components/responses/CatalogUnavailable"
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"CatalogResponse": {
				"type": "object",
				"required": [
					"version",
					"generatedAt",
					"graph",
					"indexes"
				],
				"properties": {
					"version": {
						"type": "string",
						"example": "stogas.gateway.catalog.v1"
					},
					"generatedAt": {
						"type": "string",
						"format": "date-time",
						"description": "Timestamp assigned to the generated catalog payload."
					},
					"graph": {
						"type": "object",
						"description": "Resolved catalog graph: authors, models, deployments, providers, routes, and gateway endpoints.",
						"additionalProperties": true
					},
					"indexes": {
						"type": "object",
						"description": "Public lookup indexes, including provider-endpoint-scoped request slugs.",
						"additionalProperties": true
					}
				}
			},
			"ErrorResponse": {
				"type": "object",
				"properties": {
					"error": {
						"type": "object",
						"properties": {
							"message": {
								"type": "string"
							},
							"type": {
								"type": "string"
							}
						}
					}
				}
			}
		},
		"responses": {
			"CatalogUnavailable": {
				"description": "<span className=\"text-red-500 font-bold\">Internal Server Error:</span> The gateway catalog is not available.",
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/ErrorResponse"
						},
						"example": {
							"error": {
								"message": "Catalog unavailable",
								"type": "internal_error"
							}
						}
					}
				}
			}
		}
	},
	"tags": [
		{
			"name": "Catalog",
			"description": "Public model and routing discovery."
		}
	]
}