# 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](/api/runtime-apis/sql-query/http-api.md)                        |
| SQL Query (Arrow Flight) | `grpc+tls://flight.spiceai.io` | [Arrow Flight API](/api/runtime-apis/sql-query/apache-arrow-flight-api.md) |
| LLM Chat Completions     | `POST /v1/chat/completions`    | [LLM API](/api/runtime-apis/openai-api.md)                                 |
| Search                   | `POST /v1/search`              | [Search API](/api/runtime-apis/search.md)                                  |
| Health                   | `GET /health`                  | [Health API](/api/runtime-apis/health.md)                                  |
| Metrics                  | `GET /v1/metrics`              | [Metrics API](/api/runtime-apis/metrics.md)                                |

## 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](broken://pages/Cxualhhbj3JVjFycQplA)             |
| Deployments      | [Deployments API](broken://pages/cW4Y9zvF1YF9X2ExU15D)      |
| Secrets          | [Secrets API](broken://pages/jux7LfeRfZnBFKMpjIXA)          |
| API Keys         | [API Keys API](broken://pages/C2SEPG58kdQqhs4SL9B7)         |
| Members          | [Members API](broken://pages/fDcgKtae3y2pEzLWtbVg)          |
| Regions          | [Regions API](broken://pages/6ZPPX3ncuyaq7usBYCzO)          |
| Container Images | [Container Images API](broken://pages/5fsccwHHHi12wJt5s0Ca) |
| Health           | [Health API](broken://pages/MMiAVKRYaydEPCc1zdZU)           |

See the full [Management API reference](/api/management-api/management.md) 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spice.ai/api/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
