Skip to content

Commit 621784c

Browse files
authored
Merge pull request #18 from GoodRxOSS/agent-token-pricing
document token pricing
2 parents 53bdd11 + 1219a73 commit 621784c

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed

src/pages/docs/features/_meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ export default {
4747
},
4848
"mcp-integration": {
4949
"title": "MCP Integration"
50-
},
50+
}
5151
};

src/pages/docs/features/ai-agent-configuration.mdx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,78 @@ The effective config for `myorg/frontend`:
7777
}
7878
```
7979

80+
### Provider and model configuration
81+
82+
The `providers` field defines which LLM providers and models are available. This is a **global-only** field — repository overrides cannot change provider configuration.
83+
84+
Each provider entry has the following structure:
85+
86+
| Field | Type | Required | Description |
87+
| -------------- | --------------- | -------- | ----------------------------------------------------- |
88+
| `name` | `string` | Yes | Provider identifier (`anthropic`, `openai`, `gemini`) |
89+
| `enabled` | `boolean` | Yes | Whether this provider is available |
90+
| `apiKeyEnvVar` | `string` | Yes | Environment variable containing the API key |
91+
| `models` | `ModelConfig[]` | Yes | List of models for this provider |
92+
93+
Each model entry:
94+
95+
| Field | Type | Required | Description |
96+
| ---------------------- | --------- | -------- | --------------------------------------------------------------- |
97+
| `id` | `string` | Yes | Model identifier sent to the provider API |
98+
| `displayName` | `string` | Yes | Human-readable name shown in the UI dropdown |
99+
| `enabled` | `boolean` | Yes | Whether this model is selectable |
100+
| `default` | `boolean` | Yes | Whether this is the default model (one per provider) |
101+
| `maxTokens` | `integer` | Yes | Maximum output tokens for the model |
102+
| `inputCostPerMillion` | `number` | No | Cost per 1M input tokens (USD). Enables cost display in the UI |
103+
| `outputCostPerMillion` | `number` | No | Cost per 1M output tokens (USD). Enables cost display in the UI |
104+
105+
<Callout type="info">
106+
When `inputCostPerMillion` and `outputCostPerMillion` are both set for a
107+
model, the UI displays a computed cost alongside token counts in the X-Ray
108+
debug panel. If either field is omitted, cost is not shown.
109+
</Callout>
110+
111+
Example with pricing configured:
112+
113+
```json
114+
{
115+
"providers": [
116+
{
117+
"name": "anthropic",
118+
"enabled": true,
119+
"apiKeyEnvVar": "ANTHROPIC_API_KEY",
120+
"models": [
121+
{
122+
"id": "claude-sonnet-4-20250514",
123+
"displayName": "Claude Sonnet",
124+
"enabled": true,
125+
"default": true,
126+
"maxTokens": 8096,
127+
"inputCostPerMillion": 3.0,
128+
"outputCostPerMillion": 15.0
129+
}
130+
]
131+
},
132+
{
133+
"name": "gemini",
134+
"enabled": true,
135+
"apiKeyEnvVar": "GEMINI_API_KEY",
136+
"models": [
137+
{
138+
"id": "gemini-2.5-pro-preview-05-06",
139+
"displayName": "Gemini 2.5 Pro",
140+
"enabled": true,
141+
"default": true,
142+
"maxTokens": 65536,
143+
"inputCostPerMillion": 1.25,
144+
"outputCostPerMillion": 10.0
145+
}
146+
]
147+
}
148+
]
149+
}
150+
```
151+
80152
### Caching
81153

82154
<Callout type="info">

0 commit comments

Comments
 (0)