https://api.openfinance.tech/agent/v1 and reads your key from an environment variable. For what the API is and how billing works, see the overview. Set the key once in your shell:
A first request
Here is the same request in curl, Python and TypeScript:Streaming
Setstream to true to receive the reply as it is written.
List the models
model value. Ids use a provider/model form.
Check your credits
availableCredits in the response. Top up in the OpenFinance app when it runs low; see Models and AI credits.
Switching from another provider
If your code already uses an OpenAI-compatible client, change two lines:GET /models.
Tips
- Either header works.
Authorization: Bearer open_...suits OpenAI-style clients.x-api-key: open_...matches what you already send to the MCP server. - Run it server-side. The key can also trade and move funds, so it must never reach a browser or a mobile app.
- Handle rejected requests. If a request is rejected for an invalid key, check that the key starts with
open_. If it is rejected for insufficient credits, top up and retry.
Next
Inference overview
Endpoints, auth and credits.
MCP overview
Let an AI client trade through OpenFinance.

