Authentication
Learn how to authenticate ApiFinance AI API requests and how billing works for public endpoints.
Authenticate your ApiFinance AI REST API requests with a user-owned API key.
Overview
Every public stock-data endpoint in this documentation requires an API key in the Authorization header.
Header Format
Authorization: Bearer <your_api_key>
If the header is missing, invalid, disabled, or expired, the API returns an authentication error and the request does not run.
Base URL
Use this base URL for all examples in this documentation:
https://api.apifinance.ai
Endpoint paths are shown relative to that base URL, for example:
/securities/search
Authentication Rules
- All documented public endpoints except
/healthrequire a valid API key. - API keys are tied to a user account and its credit balance.
- Interactive MCP access uses OAuth instead of the
Authorizationheader.
Parameter Conventions
tickeris passed either in the URL path under/securities/{ticker}/...or as a query parameter on calendar, filing, and statement endpoints.limit,page, andper_pagemust be positive integers.- Statement endpoints accept
timeframe, typicallyannual,quarterly, orttm. - Search accepts
query,page, andper_page. - Price history and insider trading filters accept
startandendinYYYY-MM-DDformat. - Statement
startandendfilters operate on fiscal year boundaries.
Billing Behavior
- Billable endpoints check available credits before processing the request.
- Credits are charged only when the final HTTP status is successful.
- Requests that fail with
4xxor5xxresponses do not deduct credits.
Example Request
curl -H "Authorization: Bearer $your_api_key" \
"https://api.apifinance.ai/securities/AAPL/quote"
Next step
Move from docs into a real evaluation flow
Check the playground, review trust details, and create a key only after the response shape and coverage fit your workflow.