# n8n

Connect n8n to Felo Model API and Data API. Use a compatible model for generation and a separate HTTP tool for search data.

Connect n8n to Felo Model API and Data API. Use a compatible model for generation and a separate HTTP tool for search data.

## Before you start

Get an API key and check your available credits. This example uses the Tavily search endpoint; other Data APIs have their own parameters and prices.

- [API Keys](https://openapi.felo.ai/console/api-keys)
- [Data APIs](https://openapi.felo.ai/apis)
- [Tavily](https://openapi.felo.ai/apis/tavily)

## Set up the application

Open **Workflow → HTTP Request → Import cURL / Send Body → JSON → Execute step**. Configure the fields below, save the connection, then run a test request. UI labels can vary by version.

## Connect the data tool

```text
HTTP Request → results[] → next node / agent context
JSON output: {{$json.results}}
```

Import the OpenAPI file below, or configure a JSON HTTP POST request with these fields. Keep the key in the application credential settings. Pass query as the task input and return results to the next step.

[OpenAPI JSON](https://openapi.felo.ai/docs-assets/integrations/felo-data-search.openapi.json)

## Data API request

| Field | Value |
| --- | --- |
| Method | `POST` |
| URL | `https://openapi.felo.ai/v1/beta/tavily/search` |
| Authorization | `Bearer YOUR_FELO_API_KEY` |
| OpenAPI credential | `X-API-Key: YOUR_FELO_API_KEY` |
| Content-Type | `application/json` |
| query | `Felo API Platform documentation` |
| max_results | `3` |
| Output | `results[].title`, `results[].url`, `results[].content` |

```json
{
  "query": "Felo API Platform documentation",
  "max_results": 3
}
```

```bash
export FELO_API_KEY='YOUR_FELO_API_KEY'
curl 'https://openapi.felo.ai/v1/beta/tavily/search' \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "query": "Felo API Platform documentation",
  "max_results": 3
}'
```

## Model API connection

Copy a Model ID from the model directory. Use the OpenAI-compatible Base URL below; keep the Data API endpoint in a separate HTTP tool.

Open **Workflow → HTTP Request → POST → /api/v1/chat/completions**. Configure the fields below, save the connection, then run a test request. UI labels can vary by version.

| Field | Value |
| --- | --- |
| Base URL | `https://openapi.felo.ai/api/v1` |
| API Key | `YOUR_FELO_API_KEY` |
| Model ID | `YOUR_MODEL_ID` |
| HTTP POST | `https://openapi.felo.ai/api/v1/chat/completions` |
| Output | `choices[0].message.content` |

[Model ID](https://openapi.felo.ai/models) · [Protocols](https://openapi.felo.ai/docs/guides/protocols.md)

```json
{
  "model": "YOUR_MODEL_ID",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "stream": false
}
```

```bash
curl 'https://openapi.felo.ai/api/v1/chat/completions' \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "YOUR_MODEL_ID",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "stream": false
}'
```

## Verify the integration

Run one search and check for a real results array containing title, url and content. Ask the agent to summarize those results and cite the returned URLs. An empty array is a valid result, not proof of failure. Review the API usage record to confirm the request went through Felo.

## Troubleshooting

401: check the key and Authorization header. 402: check credits. 400: check the JSON body and query field. 429 or 5xx: retry with backoff. Save the request_id for support. For Workspace, check script authorization and document sharing; for computer tools, check the key in that execution environment.

## Related Felo documentation

- [Data API](https://openapi.felo.ai/docs/guides/data-api.md)
- [API Reference](https://openapi.felo.ai/docs/data-api)
- [Authentication](https://openapi.felo.ai/docs/authentication.md)
- [Apps & Agents](https://openapi.felo.ai/apps)

## Official application documentation

- [n8n](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/)
