Skip to content

Commit c68cadf

Browse files
committed
Docs
1 parent 95d93a2 commit c68cadf

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

apps/docs/content/docs/copilot/index.mdx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,26 @@ Copilot is your in-editor assistant that helps you build, understand, and improv
9191
>
9292
<div className="m-0 text-sm">Maximum reasoning for deep planning, debugging, and complex architectural changes.</div>
9393
</Card>
94-
</Cards>
94+
</Cards>
95+
96+
## Billing and Cost Calculation
97+
98+
### How Costs Are Calculated
99+
100+
Copilot usage is billed per token from the underlying LLM:
101+
102+
- **Input tokens**: billed at the provider's base rate (**at-cost**)
103+
- **Output tokens**: billed at **1.5×** the provider's base output rate
104+
105+
```javascript
106+
copilotCost = (inputTokens × inputPrice + outputTokens × (outputPrice × 1.5)) / 1,000,000
107+
```
108+
109+
| Component | Rate Applied |
110+
|----------|----------------------|
111+
| Input | inputPrice |
112+
| Output | outputPrice × 1.5 |
113+
114+
<Callout type="info">
115+
Model prices are per million tokens. The calculation divides by 1,000,000 to get the actual cost. See <a href="/execution/advanced#cost-calculation">Logging and Cost Calculation</a> for background and examples.
116+
</Callout>

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ export async function POST(req: NextRequest) {
372372
streamToolCalls: true,
373373
mode: mode,
374374
messageId: userMessageIdToUse,
375+
chatId: actualChatId,
375376
...(providerConfig ? { provider: providerConfig } : {}),
376377
...(effectiveConversationId ? { conversationId: effectiveConversationId } : {}),
377378
...(typeof effectiveDepth === 'number' ? { depth: effectiveDepth } : {}),

0 commit comments

Comments
 (0)