API Request Builder
Assemble a query POST /v1/messages complete. The JSON (JavaScript Object Notation) updates live, along with a simulated response illustrating the stop_reason expected. ⚠ Model names and prices volatile — check docs.anthropic.com.
assistant partial "{" (forces JSON)
SSE Streaming Viewer
SSE = Server-Sent Events: unidirectional HTTP flow text/event-stream . Run the simulation and watch each event happen — this is exactly the sequence your code should parse. Certification trick question: in what event happens stop_reason final?
message_start → content_block_start → content_block_delta× n → content_block_stop → message_delta → message_stop . THE ping interspersed are keep-alives to be ignored.Token counter & cost calculator
Paste a text: estimation of the number of tokens (local heuristic — in production, use the endpoint count_tokens of the API, each family of models having its own tokenizer) and calculation of the cost per model. ⚠ Indicative and volatile prices.
| Model ⚠ | Entry $/Mtok ⚠ | Output $/Mtok ⚠ | Cost/call | Cost / day | Cost / month (30 days) |
|---|
count_tokens is authentic for the model actually called.