# Getting Started

Create one Felo key, then connect an AI tool with one command or call the API directly.

Felo API Platform gives you **one API key** for model APIs, Data APIs, search, web fetch, image/video, and agent workflows.

::: tip AI agent reading this?
Jump to [Agent instructions](#agent-instructions) and run the setup yourself. The machine-readable version of this page is [getting-started.md](https://openapi.felo.ai/docs/getting-started.md).
:::

## Choose an API and its balance

| API | Payment | Guide |
|---|---|---|
| Data API (Felo and other providers) | Platform balance | [API directory](https://openapi.felo.ai/docs/data-api) |
| Felo Data API (`/api/v1/data`) | Platform balance | [Felo API Setup](https://openapi.felo.ai/docs/data-api/guides/felo-overview) |
| Model API | Platform balance | [Platform overview](https://openapi.felo.ai/docs/guides/overview.md) |

Set up Felo endpoints in Data API for search, web content, X data and presentations, using platform balance. [Felo API Setup](https://openapi.felo.ai/docs/data-api/guides/felo-overview) · [OpenAPI Billing and Errors](https://openapi.felo.ai/docs/data-api/guides/felo-billing)

## Two ways to connect

| You want to... | Start with |
|---|---|
| Use Felo inside Codex, Claude Code, Pi, OpenCode, Cursor, or another AI tool | [Option A: one command](#option-a-use-felo-inside-an-ai-tool) |
| Call Felo from your own app, script, or backend | [Option B: direct API](#option-b-call-the-api-directly) |

You need both a Felo key and service credits. No subscription is required.

## 1. Get one API key

One Felo key works for model calls, Data API, search, image/video, and workflows.

1. Open [Felo Console → API Keys](https://openapi.felo.ai/console/api-keys).
2. Create a key and copy the full value. It is shown only once.
3. Store it as `FELO_API_KEY` in the environment where your app or agent runs.

```bash
export FELO_API_KEY="YOUR_API_KEY"
```

```powershell
$env:FELO_API_KEY="YOUR_API_KEY"
```

::: warning Keep the key secret
Never commit a key, print it in logs, or paste it into a chat. If a tool asks for it interactively, paste it into that hidden prompt.
:::

## Option A: use Felo inside an AI tool

For Codex, Claude Code, Pi, OpenCode, Cursor, Cline, and other supported agents.

Requires Node.js 22+. From a normal terminal:

```bash
npm install -g feloapi-cli@latest; feloapi onboard
```

`feloapi onboard` does four things:

1. Shows the key page.
2. Saves the key you paste into a hidden prompt.
3. Detects installed AI tools.
4. Installs the Felo Skill into the selected tools.

It does **not** change your model or provider. If you already use Claude, GPT, or another model, that account stays as it is.

Verify:

```bash
feloapi auth status
feloapi skill list
```

Then open a new agent session and ask:

```text
Use feloapi to look up the Ahrefs DR for example.com.
```

Need manual setup instead? Use the [Codex guide](https://openapi.felo.ai/docs/agent-clients/codex.md), [Claude Code guide](https://openapi.felo.ai/docs/agent-clients/claude-code.md), or [FeloAPI CLI](https://openapi.felo.ai/docs/cli.md).

## Option B: call the API directly

### Base URLs and endpoints

| Protocol | Base URL | Endpoint |
|---|---|---|
| OpenAI Chat Completions | `https://openapi.felo.ai/api/v1` | `POST /chat/completions` |
| OpenAI Responses | `https://openapi.felo.ai/api/v1` | `POST /responses` |
| Anthropic Messages | `https://openapi.felo.ai/api` | `POST /v1/messages` |
| Felo Data API | `https://openapi.felo.ai/api/v1/data` | `POST /web/search` |

Use your Felo key as the API key. Choose a current model ID from the [model catalog](https://openapi.felo.ai/models); do not guess IDs.

### First request (OpenAI-compatible)

```bash
curl -sS https://openapi.felo.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-5-5",
    "messages": [{"role": "user", "content": "Say OK"}],
    "max_tokens": 16
  }'
```

A successful call returns HTTP 200 and `choices[0].message.content`.

### First request (Anthropic-compatible)

```bash
curl -sS https://openapi.felo.ai/api/v1/messages \
  -H "x-api-key: $FELO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-5-5",
    "max_tokens": 16,
    "messages": [{"role": "user", "content": "Say OK"}]
  }'
```

The Anthropic endpoint requires `max_tokens` and returns `content[0].text`.

If you use an SDK, see [Protocols and SDKs](https://openapi.felo.ai/docs/guides/protocols.md). For the Data API, see [Data API](https://openapi.felo.ai/docs/guides/data-api.md).

### Data API · Web Search

Find web pages and return titles, links and snippets.

```bash
curl -sS --request POST "https://openapi.felo.ai/api/v1/data/web/search" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"retrieval augmented generation","count":3}'
```

HTTP 200 returns the results at the JSON root:

```json
{
  "resources": [
    {"title":"Example guide","link":"https://example.com/guide","snippet":"An introduction to retrieval augmented generation."}
  ],
  "total": 1
}
```

[Web Search](https://openapi.felo.ai/docs/data-api/guides/felo-web-search) · [OpenAPI Billing and Errors](https://openapi.felo.ai/docs/data-api/guides/felo-billing)

## Agent instructions

Use this section when the user asks you to connect Felo, or points you at this page.

**Copyable setup request:**

```text
Set up Felo using https://openapi.felo.ai/docs/getting-started.md.
Follow the Agent instructions on that page. Run the commands yourself when a shell is available.
Do not ask me to paste my API key into chat. Do not change unrelated model settings.
```

**Rules:**

- Reuse an existing working Felo key or Skill connection. Do not reinstall or migrate automatically.
- There is **one** Felo key. It covers model calls and Data APIs. Never print, log, or commit it.
- If the user already has a model, do not replace it. Option A only adds the Felo Skill.
- Do not invent endpoints, headers, or model IDs. Use this page and the [model catalog](https://openapi.felo.ai/models).

**Run this flow:**

1. Decide the path. If the user wants Felo inside an AI tool, use Option A. If the user wants HTTP calls from their app, use Option B. Do not force the CLI on an API-only user.
2. Option A: run `npm install -g feloapi-cli@latest; feloapi onboard`.
   - If the key is missing, open `https://openapi.felo.ai/console/api-keys` and ask the user to paste the key into the terminal prompt, never into chat.
   - In a non-interactive shell, use `printf '%s' "$FELO_API_KEY" | feloapi onboard --key-stdin --yes`.
   - Verify with `feloapi auth status` and `feloapi skill list`.
3. Option B: confirm `FELO_API_KEY` is set. For model calls, choose the OpenAI or Anthropic base URL; for Felo Data API, use the web search example below `/api/v1/data`. Run one minimal request and verify HTTP 200 and the documented response fields.
4. If a sandbox, missing write permission, or missing key blocks you, stop and report the exact command the user must run. Do not switch to another provider or bypass the missing step.
5. Report what was installed or called, and include one verification result.

## Supported AI tools

| Tool | Setup guide |
|---|---|
| Codex | [Set up Codex](https://openapi.felo.ai/docs/agent-clients/codex.md) |
| Claude Code | [Set up Claude Code](https://openapi.felo.ai/docs/agent-clients/claude-code.md) |
| OpenCode | [Set up OpenCode](https://openapi.felo.ai/docs/agent-clients/opencode.md) |
| Cursor | [Set up Cursor](https://openapi.felo.ai/docs/agent-clients/cursor.md) |
| Cline | [Set up Cline](https://openapi.felo.ai/docs/agent-clients/cline.md) |
| Roo Code | [Set up Roo Code](https://openapi.felo.ai/docs/agent-clients/roo-code.md) |
| Kilo Code | [Set up Kilo Code](https://openapi.felo.ai/docs/agent-clients/kilo-code.md) |
| Other tools | [Set up other tools](https://openapi.felo.ai/docs/agent-clients/other-tools.md) |

## Add workflow APIs

- [Web Search](https://openapi.felo.ai/docs/data-api/guides/felo-web-search) — Find web pages and return titles, links and snippets.
- [Web Read](https://openapi.felo.ai/docs/data-api/guides/felo-web-read) — Read a URL as Markdown, text, HTML or a screenshot.
- [X Data](https://openapi.felo.ai/docs/data-api/guides/felo-x-data) — Retrieve X profiles, search users and posts, and paginate timelines and replies.
- [Search-grounded Chat](https://openapi.felo.ai/docs/data-api/guides/felo-chat) — Generate an answer with web sources using platform balance.
- [PPT Generation and Export](https://openapi.felo.ai/docs/data-api/guides/felo-ppt) — Create a presentation, poll its progress, export a PPTX and manage its lifetime.

## Troubleshooting

| Symptom | Check |
|---|---|
| `401` | `FELO_API_KEY` is set and is the current key |
| `404` on every request | OpenAI base URL ends at `/api/v1`; Anthropic base URL ends at `/api` without `/v1` |
| `400` model error | Use a current model ID from the [model catalog](https://openapi.felo.ai/models) |
| CLI cannot find the key | Run `feloapi auth login`, or `feloapi onboard` again |
| Skill not visible | Start a new agent session; run `feloapi skill list` |

Still stuck? See [Authentication](https://openapi.felo.ai/docs/authentication.md), [Errors and limits](https://openapi.felo.ai/docs/guides/errors-and-limits.md), or [Troubleshooting](https://openapi.felo.ai/docs/faq/troubleshooting.md).
