Feedra.ai

Feedra API

Use every Feedra model from your own code, scripts and tools with the OpenAI SDKs you already have. Billing comes from your Feedra plan and credits, the same as the apps.

Base URL: https://api.feedra.ai/openai/v1 Key: create one under Account → API keys in the app (it starts with fd_). Keep it secret.

Quick start

from openai import OpenAI
client = OpenAI(base_url="https://api.feedra.ai/openai/v1", api_key="fd_...")
r = client.chat.completions.create(model="auto", messages=[{"role": "user", "content": "Write a haiku about hay"}])
print(r.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.feedra.ai/openai/v1", apiKey: process.env.FEEDRA_KEY });
const stream = await client.chat.completions.create({ model: "claude-sonnet-5-5", stream: true, messages: [{ role: "user", content: "Hello" }] });
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
curl https://api.feedra.ai/openai/v1/chat/completions -H "Authorization: Bearer $FEEDRA_KEY" -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hi"}]}'

Endpoints

GET /modelsThe models your plan can use, plus auto
POST /chat/completionsChat. Supports stream, stream_options.include_usage, max_tokens / max_completion_tokens, system and developer messages, and images (image_url parts with a data URL or a public https URL)

Models: auto picks a fast model for easy questions and a strong one for hard ones. Or name any model from GET /models, for example claude-sonnet-5-5, gpt-6-luna or gemini-3.1-flash-lite.

Web search (Feedra extra): add "web_search": true to let models that support it search the web.

Usage: each response's usage includes feedra_credits, the credits it used.

Not yet supported: function calling (tools), embeddings, audio and image generation endpoints. Requests with tools get a clear 400 error.

Evals

Build eval suites in the app (Evals): a prompt with {{variables}}, test cases, and checks: contains, not_contains, equals, regex, json (optionally with required keys), max_words, and ai (a grader model judges each answer against your rubric). Run them across up to 6 models and compare pass rates, speed and cost.

Run one from CI with the CLI. It exits with status 1 if any model passes less than --min (default: every case):

FEEDRA_API_KEY=fd_... npx feedra eval "Support replies" --models claude-sonnet-5-5 --min 0.9

GitHub Actions:

- run: npx -y feedra eval "Support replies" --min 0.9
  env:
    FEEDRA_API_KEY: ${{ secrets.FEEDRA_API_KEY }}

Or call the API: GET /v1/evals/suites, POST /v1/evals/suites/{id}/run (body {"models": [...]}, optional), then poll GET /v1/evals/runs/{id} until status isn't running. The run has summary (per model: passed, total, avgMs, credits) and results (every answer with its checks). One run makes up to 600 model calls.

Agents

Scheduled agents can be managed and triggered with an API key too.

Webhooks

Add endpoints in Account → Webhooks or with POST /v1/webhooks {"url", "events": ["*"] or a list, "description"}. The response includes the signing secret once; GET /v1/webhooks/:id/secret shows it again (from the app only).

Events: agent.run.completed, agent.run.failed, eval.run.completed, github.review.completed, vps.app.deployed, vps.app.failed, domain.registered, trade.order.placed, and ping from Send test. Each POST body is {"id", "type", "created", "data"}. Answer with any 2xx within 15 seconds.

Every request has an X-Feedra-Signature: t=<unix time>,v1=<hex> header, where v1 is the HMAC-SHA256 of <t>.<raw body> using your secret. Reject requests whose t is more than 5 minutes old, and use the event id to ignore repeats.

import { createHmac, timingSafeEqual } from "node:crypto";
function verify(raw, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const want = createHmac("sha256", secret).update(`${t}.${raw}`).digest("hex");
  return v1.length === want.length && timingSafeEqual(Buffer.from(v1), Buffer.from(want));
}

Failed deliveries are retried after 1, 5, 30, 120, 360 and 720 minutes. After 20 failures in a row the endpoint is turned off; turn it back on in the app or with PUT /v1/webhooks/:id and "enabled": true.

SEO

Markets

Show the source.note next to any prices you display. Market data is for your own use, not for redistribution. Orders can't be placed through the API: they're drafted in chat and confirmed in the Feedra app.

Your own provider keys

If you've added your own provider key (Account → Your API keys), requests to that provider's models run on your key: usage.feedra_credits is 0, and /models also lists the models your key unlocks. If the provider rejects your key, you get a 400 with code provider_key_rejected; Feedra doesn't switch to its own key.

Errors

Errors use OpenAI's shape: {"error": {"message": "...", "type": "...", "code": "..."}}. 401 means a bad key, 403 a model your plan doesn't include, 404 an unknown model, and 429 that you're out of credits or sending too fast (120 requests a minute).

Use it in your tools

Anything that lets you set an OpenAI base URL works. Examples:

Command line

npm install -g feedra
feedra login                        # paste your fd_ key
feedra "how do I reverse a list in Go?"
cat crash.log | feedra "what went wrong?"
git diff | feedra "write a commit message"
feedra chat -m claude-sonnet-5-5    # interactive
feedra deploy ./my-site             # deploy a folder to your Feedra server
feedra logs my-site
feedra domains ranchero coffee

In CI, set FEEDRA_API_KEY instead of running feedra login.

VS Code

Install Feedra AI from the VS Code Marketplace (or download the .vsix and use Extensions → … → Install from VSIX). Run Feedra: Sign in with API key. Then:

MCP

Feedra speaks the Model Context Protocol both ways.

Use Feedra from other apps

Feedra is an MCP server at https://api.feedra.ai/mcp (Streamable HTTP). Authenticate with an API key as a Bearer token. Tools:

Claude Code:

claude mcp add --transport http feedra https://api.feedra.ai/mcp --header "Authorization: Bearer fd_..."

Cursor (~/.cursor/mcp.json) and VS Code (.vscode/mcp.json, use "servers" and add "type": "http"):

{ "mcpServers": { "feedra": { "url": "https://api.feedra.ai/mcp", "headers": { "Authorization": "Bearer fd_..." } } } }

Claude Desktop (claude_desktop_config.json), through the mcp-remote bridge:

{ "mcpServers": { "feedra": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.feedra.ai/mcp", "--header", "Authorization:Bearer fd_..."] } } }

Connect MCP servers to Feedra chat

In the app, Account → Connected tools (MCP) → Connect an MCP server. Paste the server's URL (remote servers only: Streamable HTTP). If it uses sign-in (OAuth), Feedra opens it in your browser; if it gave you a token, paste it in the token field. Claude then uses the server's tools in your chats.