﻿# API Endpoints

Most clients need an API address (base URL) during setup. Flux exposes three entry points, one per protocol format.

## Protocol Entry Points

| Protocol format  | Base URL                   | Typical request path                             |
| ---------------- | -------------------------- | ------------------------------------------------ |
| OpenAI format    | `https://api.tryflux.net/v1` | `POST /chat/completions` or `POST /responses`    |
| Anthropic format | `https://api.tryflux.net`    | `POST /v1/messages`                              |
| Gemini format    | `https://api.tryflux.net`    | `POST /v1beta/models/<model-id>:generateContent` |

The OpenAI and Anthropic endpoints can also be copied directly from the top of the [API keys page](https://tryflux.net/keys).


## Which Format to Use

The client dictates the format, and the group must support that same format.

| Format                          | Clients                                                                                   |
| ------------------------------- | ----------------------------------------------------------------------------------------- |
| OpenAI format (ends with `/v1`) | Cherry Studio, RikkaHub, OpenCode, and anything labelled "OpenAI compatible"              |
| Anthropic format (no `/v1`)     | `Claude Code` and other clients speaking the Anthropic protocol natively                  |
| Gemini format                   | Clients and SDKs on Google's native protocol, where the model ID goes in the request path |

If the client's setting is named `ANTHROPIC_BASE_URL`, use the Anthropic format. If it is `OPENAI_BASE_URL`, use the OpenAI format. `Base URL` is a generic field name and does not identify a protocol; check the selected provider type first. Each integration guide states the exact value.

The OpenAI format includes distinct APIs such as Chat Completions and Responses; Codex uses Responses, for example. Sharing a base URL does not mean a model supports every API. Check that the group and model support the requests your client sends. Complete test requests are in [Troubleshooting](https://docs.tryflux.net/en/docs/troubleshooting.md#send-a-minimal-inference-request).

## Authentication

The API key is sent in a request header, which most clients handle automatically.

| Entry point                     | Accepted credentials                                                       |
| ------------------------------- | -------------------------------------------------------------------------- |
| OpenAI format, Anthropic format | `Authorization: Bearer <key>`, `x-api-key: <key>`, `x-goog-api-key: <key>` |
| Gemini format                   | All of the above, plus the query parameter `?key=<key>`                    |

The OpenAI and Anthropic formats do not accept a key in the query string and return 400. On the Gemini format, `?api_key=` is deprecated; use `?key=` or a header.

With a [composite key](https://docs.tryflux.net/en/docs/flux/composite-key.md), the model ID needs a prefix; on the Gemini format the prefix goes in the path.

## Related Pages

- [Create API Key](https://docs.tryflux.net/en/docs/flux/create-apikey.md) - get a key first
- [Quickstart](https://docs.tryflux.net/en/docs/quickstart.md) - pick an integration path by client
- [Troubleshooting](https://docs.tryflux.net/en/docs/troubleshooting.md) - what to check when a client cannot connect
- [Error Codes](https://docs.tryflux.net/en/docs/errors.md) - the full list of authentication and request errors
