Fetch AI prices
POST
/api/settings/ai/prices/fetchFetch model prices from OpenRouter now. Answers 502 with the reason when OpenRouter could not be reached or refused. Never retried.
Needs the ManageSettings permission.
AuthorizationBearer <token>
An API key, made on Settings, API keys. Every key starts with mbk_.
In: header
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/api/settings/ai/prices/fetch"{ "now": "2019-08-24T14:15:22Z", "today": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "spend": [ { "feature": "string", "label": "string", "today": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "week": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "lastMonth": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "estimate": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 } } ], "total": { "feature": "string", "label": "string", "today": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "week": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "lastMonth": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "estimate": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 } }, "firstDay": "2019-08-24", "lastDay": "2019-08-24", "days": [ { "day": "2019-08-24", "feature": "string", "cost": 0.1, "tokens": 0, "unpricedTokens": 0 } ], "limits": [ { "appliesTo": "string", "feature": null, "roleId": null, "userId": null, "name": null, "perDay": null, "perMonth": null, "today": null, "month": null, "estimate": null } ], "tokenLimits": [ { "feature": "string", "monthlyTokens": 0, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "estimate": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 } } ], "topChatUsers": [ { "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b", "username": null, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 } } ], "prices": [ { "model": "string", "inputPerMillion": 0.1, "cachedInputPerMillion": null, "outputPerMillion": 0.1 } ], "models": [ { "model": "string", "entered": null, "fetched": null } ], "pricesFetchedAt": null, "modelsUsed": [ "string" ], "features": [ { "id": "string", "label": "string" } ], "roles": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "users": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "allowances": { "default": { "tokens": null, "money": null }, "members": [ { "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b", "name": "string", "own": null, "allowance": { "tokens": null, "money": null }, "month": { "cost": 0.1, "inputTokens": 0, "cachedInputTokens": 0, "outputTokens": 0, "unpricedTokens": 0 }, "pastLimits": true } ], "resetsAt": "2019-08-24T14:15:22Z" }}Update AI prices PUT
Replace the prices the operator entered. Needs the `ManageSettings` permission.
Update team AI allowances PUT
Set how many tokens and how many US dollars each team member may use in a month: one default for every member and, where wanted, an allowance of a member's own. A change is recorded in the audit log. Needs the `ManageSettings` permission.