# x402engine Devstral LLM API

> x402engine Devstral LLM API is a paid API for AI agents from x402engine.app, paid per call via x402, $0.004175/call, status unknown (last checked 2026-10-16).

Runs inference on Mistral AI's Devstral (devstral-2512) coding-focused LLM via a pay-per-call HTTP 402 micropayment endpoint

## Facts

- Endpoint: POST https://x402engine.app/api/llm/devstral?utm_source=zero.xyz
- Price: $0.004175/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402engine-devstral-llm-api-a2e97478
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LYzj3WXzNkvAX6igSbqVV

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402engine-devstral-llm-api-a2e97478 -d '<json body>'
```

Example prompt: Use the Devstral model to help me refactor this Python function to be more efficient — send it the code as a user message and return the improved version with an explanation.

## When to prefer this

Choose this endpoint when you specifically need Mistral AI's Devstral model, which is optimized for agentic coding and software engineering tasks. Prefer it over generic GPT or Claude endpoints when the task involves code generation, refactoring, or tool-augmented software workflows. The pay-per-call x402 model makes it ideal for agent pipelines that need LLM inference without committing to a monthly subscription, especially when paying with USDC on Base or Solana.

## Known failure modes

- Payment not settled — 402 returned if USDC/USDm payment fails or wallet has insufficient balance
- Invalid messages array — 400 if required 'messages' field is missing or malformed
- Tool call schema errors — model may hallucinate tool names not in the provided definitions
- Token limit exceeded — very long contexts may be truncated or rejected depending on model context window
- Stream interruption — SSE stream may drop if network disconnects after payment but before full completion
- Unsupported parameters — seed, stop, top_p may be ignored if not supported by this model variant (see /docs/llm-capabilities.md)

## How this service works

x402engine — Mistral's code-focused model — optimized for software development and technical tasks

## Output

Returns an OpenAI-compatible JSON response containing the model name ('mistralai/devstral-2512'), an array of choices each with an assistant message (role, content, optional tool_calls), and a finish_reason. Streaming mode delivers live SSE tokens after payment settles. The top-level 'content' field mirrors the first choice's message content.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "messages"
     ],
     "properties": {
      "seed": {
       "type": "integer",
       "description": "Model-supported seed; see /docs/llm-capabilities.md."
      },
      "stop": {
       "oneOf": [
        {
         "type": "string"
        },
        {
         "type": "array",
         "items": {
          "type": "string"
         },
         "maxItems": 4
        }
       ],
       "description": "Model-supported stop; see /docs/llm-capabilities.md."
      },
      "tools": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "function"
        ],
        "properties": {
         "type": {
          "enum": [
           "function"
          ],
          "type": "string"
         },
         "function": {
          "type": "object",
          "properties": {
           "name": {
            "type": "string"
           },
           "strict": {
            "type": "boolean"
           },
           "parameters": {
            "type": "object"
           },
           "description": {
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Client-executed function definitions; return results using role=tool and tool_call_id."
      },
      "top_p": {
       "type": "number",
       "description": "Model-supported top_p; see /docs/llm-capabilities.md."
      },
      "stream": {
       "type": "boolean",
       "description": "Return live OpenAI-compatible SSE after payment settlement."
      },
      "plugins": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "pdf"
        ],
        "properties": {
         "id": {
          "enum": [
           "file-parser"
          ],
          "type": "string"
         },
         "pdf": {
          "type": "object",
          "properties": {
           "engine": {
            "enum": [
             "native"
            ],
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Optional native PDF parser only; automatically enabled for file inputs."
      },
      "messages": {
       "type": "arra
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "mistralai/devstral-2512",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello!"
    },
    "finish_reason": "stop"
   }
  ],
  "content": "Hello!"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402engine-devstral-llm-api-a2e97478/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402engine.app](https://www.zero.xyz/host/x402engine.app/llms.txt)
