{"uid":"cap_hTJyrVb429gcabqbsVYUD","slug":"mistral-ai-chat-f65942df","name":"Mistral Chat Completion","description":"Create a chat completion. Supports function calling, JSON mode, structured output, vision, reasoning, web search, and document context.","url":"https://mistral.mpp.paywithlocus.com/mistral/chat?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["model","messages","max_tokens"],"properties":{"seed":{"type":"number","description":"Deterministic sampling seed"},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{}}],"description":"Stop sequences"},"model":{"type":"string","description":"Model ID (e.g. \"mistral-medium-3-5\", \"mistral-small-2603\", \"mistral-large-2512\", \"ministral-14b-2512\", \"codestral-latest\")"},"tools":{"type":"array","items":{},"description":"Tool/function definitions"},"top_p":{"type":"number","description":"Nucleus sampling (0-1)"},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"name":{"type":"string"},"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","required":["type"],"properties":{"text":{"type":"string"},"type":{"type":"string"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}},"additionalProperties":true}},"additionalProperties":true}},{"type":"null"}]},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_call_id":{"type":"string"}},"additionalProperties":true},"description":"Conversation messages array"},"max_tokens":{"type":"number","description":"Maximum output tokens. Required to bound metered x402 authorization."},"temperature":{"type":"number","description":"Sampling temperature (0-2)"},"tool_choice":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":true}],"description":"Tool selection control"},"response_format":{"type":"object","description":"Output format (json_object, json_schema, text)","additionalProperties":true}},"additionalProperties":true},"responseSchema":null,"example":{"request":{"model":"mistral-large-latest","messages":[{"role":"user","content":"Explain how machine learning algorithms work in simple terms"}],"max_tokens":500,"temperature":0.7},"response":{"data":{"id":"31028f129aad4dbda5fc034c5a69a873","model":"mistral-large-latest","usage":{"total_tokens":513,"prompt_tokens":13,"completion_tokens":500,"prompt_tokens_details":{"cached_tokens":0}},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Sure! Here’s a simple explanation of how **machine learning (ML) algorithms** work, using everyday examples:\n\n---\n\n### **1. What is Machine Learning?**\nMachine learning is like **teaching a computer to learn from experience** (data) instead of being explicitly programmed for every task. It’s similar to how you learn:\n- **Example:** A child learns to recognize cats vs. dogs by seeing many pictures of them (data) and getting feedback (\"Yes, that’s a cat!\").\n\n---\n\n### **2. How Do ML Algorithms Work?**\n#### **Step 1: Collect Data**\n- The algorithm needs **examples** to learn from (like photos, numbers, or text).\n  - *Example:* If you want to predict house prices, you’d collect data on past sales (size, location, price, etc.).\n\n#### **Step 2: Choose a Model (Algorithm)**\n- The model is like a **recipe** the computer follows to learn patterns. Common types:\n  - **Supervised Learning** (like a teacher guiding you):\n    - The algorithm learns from **labeled data** (input + correct output).\n    - *Example:* Predicting house prices (input: house features; output: price).\n    - Algorithms: Linear Regression, Decision Trees, Neural Networks.\n  - **Unsupervised Learning** (like exploring on your own):\n    - The algorithm finds **hidden patterns** in **unlabeled data** (no correct answers given).\n    - *Example:* Grouping customers by shopping habits (clustering).\n    - Algorithms: K-Means, PCA.\n  - **Reinforcement Learning** (like learning by trial and error):\n    - The algorithm learns by **rewards/punishments** (e.g., a robot learning to walk).\n    - *Example:* Self-driving cars avoiding obstacles.\n\n#### **Step 3: Train the Model**\n- The algorithm **studies the data** to find patterns.\n  - *Example:* For house prices, it might learn:\n    - \"Bigger houses cost more.\"\n    - \"Houses near schools sell for higher prices.\"\n- **How?** It adjusts its internal settings (like knobs on a radio) to **minimize errors** (e.g., predicting prices wrong).\n\n#### **Step 4: Test the Model**\n- The algorithm is given **new data it hasn’t seen before** to check if it works","tool_calls":null},"finish_reason":"length"}],"created":1781409744},"success":true}},"exampleRequest":{"model":"mistral-large-latest","messages":[{"role":"user","content":"Explain how machine learning algorithms work in simple terms"}],"max_tokens":500,"temperature":0.7},"tags":["llm","chat","embeddings","code","reasoning","ai"],"displayCostAmount":"0.014","displayCostAsset":"USDC","priceDynamic":true,"priceHint":"$0.005 – $0.10 (varies by model and tokens)","priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"dynamic","summary":"$0.005 – $0.10 (varies by model and tokens) (dynamic)","primary":{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_FrWP5EbgNOBpRx6gj3HOh","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x20c000000000000000000000b9537d11c60e8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":"Mistral AI","brandSlug":"mistral-ai","brandBaseUrl":"https://mistral.ai","brandDocsUrl":"https://docs.mistral.ai","whatItDoes":"Generates AI chat completions using Mistral AI language models including Mistral Large, Codestral, Magistral reasoning, and Pixtral vision","exampleAgentPrompt":"Using mistral-large-latest, write me a detailed explanation of how neural networks work — keep the temperature at 0.7 and limit the response to 800 tokens.","exampleUseCases":[{"title":"Real-time customer support chatbot","prompt":"I need you to handle customer inquiries about our product using Mistral Large — respond professionally but conversationally, and keep responses under 500 tokens so they load quickly in the chat interface."},{"title":"Code review and generation assistant","prompt":"Use Codestral to generate a Python function that validates email addresses with proper error handling, and then explain the approach so our junior devs understand what's happening."},{"title":"Complex reasoning for data analysis","prompt":"I'm analyzing a large dataset and need help understanding correlation patterns — use Mistral's reasoning model to break down the statistical relationships and suggest next steps for investigation."}],"resultDescription":"Returns an assistant message with the generated completion text, token usage statistics, finish reason, and optionally structured JSON or tool call payloads depending on response_format and tool configuration.","failureModes":["Invalid or unsupported model ID returns 400 error","Missing required messages array returns validation error","Exceeding max_tokens for the selected model returns truncated output or error","Malformed tool definitions cause tool_choice failures","Rate limiting or quota exhaustion returns 429 error","Invalid temperature or top_p values outside accepted ranges return 422"],"whenToPreferThis":"Choose this endpoint when you need chat completions powered by Mistral AI models specifically — especially when you want access to Mistral Large for general reasoning, Codestral for code generation, Magistral for advanced reasoning tasks, or Pixtral for vision. Prefer this over OpenAI-compatible endpoints when Mistral's model capabilities, pricing, or open-weight model availability are important to your use case.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T06:32:43.750Z","isFirstParty":false,"canonicalSlug":"mistral-ai-chat-f65942df"}