# API Reference

The Spice.ai Cloud Platform exposes two sets of APIs: **Runtime APIs** for querying data and AI, and the **Management API** for managing apps and infrastructure.

## Runtime APIs

Runtime APIs are served at `https://data.spiceai.io` and authenticated with [App API keys](https://github.com/spicehq/docs/blob/trunk/portal/apps/api-keys.md).

| API                      | Endpoint                       | Documentation                                                                                |
| ------------------------ | ------------------------------ | -------------------------------------------------------------------------------------------- |
| SQL Query (HTTP)         | `POST /v1/sql`                 | [HTTP API](https://docs.spice.ai/api/runtime-apis/sql-query/http-api)                        |
| SQL Query (Arrow Flight) | `grpc+tls://flight.spiceai.io` | [Arrow Flight API](https://docs.spice.ai/api/runtime-apis/sql-query/apache-arrow-flight-api) |
| LLM Chat Completions     | `POST /v1/chat/completions`    | [LLM API](https://docs.spice.ai/api/runtime-apis/openai-api)                                 |
| Search                   | `POST /v1/search`              | [Search API](https://docs.spice.ai/api/runtime-apis/search)                                  |
| Health                   | `GET /health`                  | [Health API](https://docs.spice.ai/api/runtime-apis/health)                                  |
| Metrics                  | `GET /v1/metrics`              | [Metrics API](https://docs.spice.ai/api/runtime-apis/metrics)                                |

## Management API

The Management API is served at `https://api.spice.ai` and authenticated with [Personal Access Tokens](https://github.com/spicehq/docs/blob/trunk/portal/profile/personal-access-tokens.md) or OAuth client credentials.

| Endpoint         | Documentation                                                      |
| ---------------- | ------------------------------------------------------------------ |
| Apps             | [Apps API](https://docs.spice.ai/api/broken-reference)             |
| Deployments      | [Deployments API](https://docs.spice.ai/api/broken-reference)      |
| Secrets          | [Secrets API](https://docs.spice.ai/api/broken-reference)          |
| API Keys         | [API Keys API](https://docs.spice.ai/api/broken-reference)         |
| Members          | [Members API](https://docs.spice.ai/api/broken-reference)          |
| Regions          | [Regions API](https://docs.spice.ai/api/broken-reference)          |
| Container Images | [Container Images API](https://docs.spice.ai/api/broken-reference) |
| Health           | [Health API](https://docs.spice.ai/api/broken-reference)           |

See the full [Management API reference](https://docs.spice.ai/api/management-api/management) for authentication, scopes, rate limits, and examples.

## OpenAPI Specification

The Spice.ai Platform API spec is available at:

```
https://api.spice.ai/v1/docs/openapi.json
```
