Provider API: failed requests and no-op agent runs are billed in full ($15.56 in under 3 minutes on gpt-5.6-sol)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
Direção de pesquisa
Comece pelo ponto de entrada da Provider API, api.commandcode.ai/provider/v1, e rastreie como são contabilizadas as solicitações com falha, as execuções vazias de agentes, os tokens de gravação em cache e os limites de gasto. Nenhum arquivo do repositório ou teste é especificado; a conclusão deve estabelecer se as chamadas com falha ou no-op são cobradas corretamente e se o comportamento do limite relatado, do aviso ou do custo por solicitação é tratado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Provider API, model gpt-5.6-sol, plan individual-goat:
$15.5624 charged across 12 requests in 2 minutes 49 seconds (2026-09-19 05:36:24-05:39:13 local UTC+8 / 2026-09-18 21:36-21:39 UTC).
Each request carried ~305k-336k tokens of context, giving an effective rate of ~$4.02 per 1M tokens. This single 3-minute burst exceeded the 5-hour window cap ($14; window shows $17.2783 used) and consumed 44% of the $35 weekly cap.
Expected Behavior
- A request that returns FAILED should not be billed in full.
- Exceeding a 5-hour window should not be reachable by one client in under 3 minutes with no warning.
- A per-API-key spend cap or alert (and/or a warning threshold before the window is exhausted) would prevent silent burn.
Actual Behavior
- The request at 05:39:13 returned FAILED and was still billed $0.2844.
- A background agent made 10 calls on gpt-5.6-sol costing ~$7.19 with no usable output at all.
- 4 of the 12 requests cost ~$3.00-3.31 each ($12.6744 = 81.4% of the spend); the other 8 cost $0.27-0.44. The expensive ones appear to be full cache-prefix rewrites billed at $6.25/1M.
- Net: $15.5624 for 3,869,607 tokens (1,306,770 input + 2,562,837 cache read + 14,367 output) = $4.02 per 1M tokens.
Steps to reproduce the issue
- Use the Provider API (api.commandcode.ai/provider/v1) with model gpt-5.6-sol on a plan that has a 5-hour window cap.
- Send requests from a client that carries a large context (~300k+ tokens per call) and does not keep the prompt prefix stable - e.g. a harness that compacts context, retries, or switches models.
- Observe ~$1.30 average per request, then the 5-hour window being exceeded within minutes.
Command Code Version
1.56.2
Operating System
Windows
Terminal/IDE
DeepSeek Harness (dsh) via Provider API, not the CLI
Shell
PowerShell
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
Requesting a review and credit for the FAILED request ($0.2844) and the 10 no-op background-agent calls (~$7.19) - failed or empty runs should not bill at full rate.
Account context:
- plan: individual-goat; billing period started 2026-09-18T12:02:57Z
- official usage summary for the period: $19.2692 over 1,573 requests, 670,391,454 input tokens / 1,170,128 output tokens
- /alpha/billing/credits at the time: fiveHour used $17.2783 / cap $14 (exceeded), weekly used $19.2547 / cap $35
Feature request that would have prevented this: expose per-request cost in the API (or a spend webhook) so clients can stop before burning a whole window. Note also that the usage API does not break out cache-write tokens, which makes client-side cost meters under-report roughly 2x for models that bill cache writes.
Happy to share the 12 request IDs from the Studio usage log.
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 4k
- Forks
- 350
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CommandCodeAI/command-code
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CommandCodeAI/command-code#855 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CommandCodeAI/command-code#841 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CommandCodeAI/command-code#655 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CommandCodeAI/command-code#608 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
CommandCodeAI/command-code#893 ·
Todas as issues de CommandCodeAI/command-code
Issues semelhantes
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
JuliusBrussee/caveman#1102 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
use-agent-os/agent-os#3263 ·
-
[Bug]: context-limit error parsing has no pattern for llama.cpp's "context size (N tokens)" phrasing Abertaarea/compression area/local-models area/sessions comp/agent duplicate P2 sweeper:risk-session-state type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NousResearch/hermes-agent#117793 · 1 comentário ·
-
possible bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mintplex-Labs/anything-llm#6415 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100