TL;DR – The whole Mistral Chat Completions API contract starts as one HTTP POST. A system message, a user message, an assistant message reply, and an optional tool message result. Four different payloads, not a list of strings. Streaming is done with Server Sent Events(SSE), JSON inside JSON. The first real “bug” was an HTTP Error 422 Unprocessable Content and the error message lied by omission.
This post is the long-form version of the first demo in the talk. The first and last time Telerik Fiddler (I’m over the licensing message) appears in the session.
The starting point
The Mistral API surface is huge (and the docs changed between the start and end of the series) Chat completions, Files, Models, Embeddings etc. The samples are TypeScript, Python and curl, which tells you who the expected audience is. I am a C# developer and only cared about chat completions.
On the top left of the docs page there is(was) a Yet Another Markup Language (YAML) download for the OpenAPI specification (the clickable link disappeared overnight). The download link is still a live, and the file is 30% bigger today.
The messages array is not a list of strings. It is four different payloads SystemMessage | UserMessage | AssistantMessage | ToolMessage.
A System Message is usually a plain string. Standing instructions, no response expected, rides along on every turn. It can be an array of typed chunks a TextChunk or ThinkChunk
A UserMessage contains the prompt. The content field is not just a string either. It can be an array of typed chunks. TextChunk. ImageURLChunk. DocumentURLChunk, ReferenceChunk, FileChunk, ThinkChunk, AudioChunk, ResourceChunk or ResourceLinkChunk
An Assistant Message is what comes back. In addition to the original UserMessage and response payload it can also carry ToolCalls. A ToolMessage closes the loop. It is a structured message with which a model asks the runtime to execute a specific tool/function on its behalf, rather than producing a plain text answer.
On the wire you send one HTTP POST with model name, SystemMessage,UserMessage, temperature, stream, and max_tokens (important for message truncation discussion). That is the entire contract. Later on both the request side and the response side, is this shape better dressed. Two different JSON payloads and this is where the DTO pain in Part 2 starts.
The demo
Non-streaming first. Fire the HTTP POST with stream off. One JSON, document comes back, choices[0].message.content. Easy to code. Dead to watch. A wall of silence, then everything at once.
{
"model": "mistral-large-latest",
"messages": [
{
"role": "user",
"content": "Explain the software acronym ACID."
}
]
}

{
"id": "5272af17c792494bb8ea6871f68e1f08",
"created": 1794546851,
"model": "mistral-large-latest",
"usage": {
"prompt_tokens": 24,
"total_tokens": 798,
"completion_tokens": 774,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 265
},
"service_tier": "standard"
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"tool_calls": null,
"content": [
{
"type": "thinking",
"thinking": [
{
"type": "text",
"text": "The user is asking for an explanation of the software acronym ACID. This is a fundamental concept in database systems and transaction processing. I should explain:\n\n1. What ACID stands for (Atomicity, Consistency, Isolation, Durability)\n2. What each property means in practical terms\n3. Why it matters (transactions, data integrity)\n4. Maybe a brief example to make it concrete\n5. Context (primarily used in relational databases)\n\nLet me structure this clearly:\n\n**ACID** stands for:\n- **Atomicity**: All-or-nothing. A transaction is treated as a single unit. Either all operations succeed or none do.\n- **Consistency**: The database moves from one valid state to another, maintaining all defined rules/constraints (integrity constraints, cascades, triggers).\n- **Isolation**: Concurrent transactions don't interfere with each other. Each sees the database as if it were the only one running.\n- **Durability**: Once committed, changes persist even in case of system failure (power loss, crash).\n\nI should mention this is crucial for financial systems, banking, etc. where data integrity is paramount.\n\nMaybe contrast briefly with BASE (NoSQL) to give context, but keep focus on ACID.\n\nLet me write this in a clear, educational tone."
}
],
"closed": true
},
{
"type": "text",
"text": "**ACID** is an acronym describing the four key properties that guarantee reliable processing of database transactions. It ensures that data remains accurate and consistent even when errors, power failures, or other mishaps occur.\n\nHere is what each letter stands for:\n\n### **A — Atomicity**\nA transaction is an **\"all-or-nothing\"** proposition. Either *all* the operations in the transaction complete successfully, or *none* of them do. If any part fails, the entire transaction is rolled back to its original state.\n- **Example:** Transferring $100 from Account A to Account B requires two steps: debit A and credit B. If the credit fails, the debit is undone. You never end up with money disappearing into thin air.\n\n### **C — Consistency**\nA transaction must take the database from one **valid state to another valid state**, preserving all defined rules and constraints (data integrity, foreign keys, unique constraints, triggers, etc.).\n- **Example:** If a database rule says an account balance cannot be negative, a transaction that would make it negative will be rejected entirely, keeping the database consistent.\n\n### **I — Isolation**\nConcurrent transactions (multiple users/processes running at the same time) must not interfere with each other. Each transaction sees the database as if it were the only one executing, preventing \"dirty reads,\" non-repeatable reads, and phantom reads.\n- **Example:** If two people book the last seat on a flight simultaneously, isolation ensures only one succeeds and the other gets an error, rather than both getting the seat.\n\n### **D — Durability**\nOnce a transaction has been **committed**, it remains so permanently—even in the event of a system crash, power loss, or hardware failure. The changes are written to non-volatile storage (like disk) before the commit is acknowledged.\n- **Example:** After you see a \"payment successful\" confirmation, the record of that payment will still exist even if the server immediately loses power.\n\n---\n\n### Why it matters\nACID properties are critical in systems where correctness is non-negotiable—**banking, financial trading, inventory management, healthcare records, and e-commerce checkout systems**. They ensure that data integrity is maintained despite concurrent access, hardware failures, and software errors.\n\n*(Note: In contrast, some distributed NoSQL databases use **BASE**—Basically Available, Soft state, Eventual consistency—trading strict ACID guarantees for higher availability and scalability.)*"
}
]
}
}
]
}
Flip stream to true. Same request. Now the response arrives as SSE. A stream of data: {…} events, ending in data: [DONE]. It looks faster and it genuinely is for the user. First tokens arrive while the model is still generating. But total time is the same. You have moved the wait into the stream.

The client has to stitch the deltas back together. Fragments and tool-call arguments arrive in pieces across chunks. Second, each one of these events is a string with JSON inside it. JSON inside JSON, parsed chunk after chunk. Get a boundary slightly wrong (like I did multiple times) and nothing fails cleanly. That is why my streaming client has a whole assembly class.
The 422 Trap
My favourite bug of the session. I accidentally changed one character in the request. The c in context to a C. The API answered 422, “missing required property”.
{
"model": "mistral-large-latest",
"messages": [
{
"role": "user",
"Content": "Explain the software acronym ACID."
}
]
}
The property was not missing. The casing was wrong. The API expects snake_case and I sent .NET’s default PascalCase(I wasn’t using DataAnnotations or JsonSerializerOptions yet)
Diff the request the docs show against the request you sent. Character by character, property by property. Casing, underscores, everything. Comment out the payload and add fields back one at a time until it breaks again. Inspect the payloads in a JSON viewer in the debugger.
Not glamorous. Not clever. Just effective. That one habit saved me more time across this project than every clever thing I did combined.
My First Chat Client
A console application. Read input, send it, print the response. The reflex of every developer since 1974 (I started coding in early then got my own compute an Amstrad CPC6128). The first surprise is structural. Every run starts from zero. No memory of the previous conversation. A Memento brain wipe.
The amnesia was never the model. The model has no state at all. It is entirely the plumbing. And there is a subtle failure mode hiding here: the model had nothing to “misremember” from, so it answers confidently either way. No wrong memory is bad. No memory answering confidently is worse, because it looks the same from the outside.
It’s Stateless(WTF)?
The API is stateless by design this is a deliberate choice, not a shortcoming. If the API held your conversation server-side, every turn would have to land on the machine holding the session. i.e. a sticky session, or every machine would have to have a shared session store.
Stickiness plus unpredictable turn times, this call runs 200ms, that one runs 30 seconds, means machines sitting reserved for slow conversations while new ones starve. Stateless means any request can run anywhere, on any GPU, and that is what makes the economics of inference work.
The vendor farms the storage problem back to you. You have the conversation on disk anyway, so it is cheap for you too. In Memento terms: the cloud has no new memories, only the polaroids you mail it.
There is a quiet upside I did not spot until much later. The client re-sends the same prefix every turn, so the API has a trick for exactly this pattern: prompt cache keys. You give the request a prompt_cache_key and the recurrent prefix gets served from cache at 10% of the token price. The stateless design quietly lends you a hand. Numbers from my logs in Part 3.
What this cost
Continuity is not free. As soon as the client re-sends the story every turn, the token count on each request climbs. Convenience and cost are the same dial. The API gives you amnesia and charges you for the cure. You build the memory, then pay per turn to keep it.
Next: Part 2. The hand-typed DTOs got fed up with me, so I went looking for the spec. The spec is 49,000 lines. It did not go well.