---
title: "Api Ai Config"
method: GET
path: "/api/ai/config"
---

# Api Ai Config

`GET /api/ai/config`

## Request

- Base URL: `https://www.oxfordledge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://www.oxfordledge.com/api/ai/config`
- Auth: none declared

Return AI capability info for the current user.

Used by the front-end to decide whether to show BYOK input, free-tier
prompt, or server-proxy mode for the new /api/ai/ask endpoint.

## Response `200`

Successful Response

- AIConfigResponse: `/api/ai/config` — AI capability info for the current user. F4 boundary backfill 2026-05-08 (Initiative 6). Frontend ask-ai.ts dereferences byok_supported / byok_providers / models / free_tier_credits / authenticated unconditionally to decide which AI mode to render (BYOK input vs free-tier prompt vs server-proxy). All 10 fields are always emitted by the handler so all are required.
  - `byok_supported` boolean, required: True iff BYOK (bring-your-own-key) flow is enabled. Currently always true; reserved as a kill-switch.
  - `byok_providers` string[], required: Supported BYOK providers. Currently ['anthropic', 'openai', 'google'].
  - `byok_configured` unknown[], required: Provider names the user has already wired up via /api/ai/keys. Empty for anon users.
    - unknown
  - `authenticated` boolean, required: True iff the request carried a valid session.
  - `free_tier_credits` integer, required: Configured free-tier daily/monthly credit limit. Read from FREE_AI_DAILY_LIMITS['free'].
  - `free_credits_used` integer, required: Credits consumed this period. Currently always 0 (placeholder until monthly budget tracking is wired).
  - `free_credits_remaining` integer, required: max(0, free_tier_credits - free_credits_used).
  - `models` object, required: Provider → model-id map for BYOK flows. Frontend renders these in the model selector.
  - `max_question_length` integer, required: Hard cap on question text length. Backend rejects above this.
  - `rag_enabled` boolean, required: True iff RAG retrieval is active. False would gate the citation UI.
  - `rag_sources` string[], required: Active RAG corpora. Currently ['sec_filings', 'earnings_transcripts'].
  - `advisory_refusal_enabled` boolean, required: True iff the advisory-refusal pattern (no specific buy/sell recs) is enforced server-side.

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
