apyhub
Back

Chat Completion with Ministral 7B

What it does

Ministral Chat Completion generates replies from a conversation using Ministral 7B Instruct, with the same request and response shape as the OpenAI Chat Completions API. Send a messages array of system, user, and assistant turns with model set to mistral-7b, and the generated reply comes back in a single synchronous call. There are no job IDs and no polling.

You can tune each call with max_tokens (default 512) and temperature (0 to 2, default 0.7). The reply is in choices[].message.content. The finish_reason field is stop or length, so you can tell when output was cut off. A usage object gives prompt, completion, and total token counts for tracking consumption.

Use it for chatbots and conversational agents, drafting and rewriting copy, summarising short text, Q&A over content you pass in, and other general language tasks where a fast reply matters more than frontier-model depth. If your code already builds OpenAI-style chat payloads, you can send them as they are.

Note: Runs Ministral-7B-Instruct-2410 (AWQ quantized) on a dedicated NVIDIA RTX 4070 Ti SUPER via vLLM. Typical response time is 1–3 seconds, depending on max_tokens.

POST
Chat completion (Ministral 7B)
https://api.eu.apyhub.com/mastera-ai/chat-completion-with-ministral-7b/v1/mistral/chat/completions

QUICKSTART

GUIDE

Quickstart

curl -X POST "https://api.eu.apyhub.com/mastera-ai/chat-completion-with-ministral-7b/v1/mistral/chat/completions" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistral-7b",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Write a short haiku about the ocean."}
    ],
    "max_tokens": 200,
    "temperature": 0.7
  }'

What you'll get back

{
  "id": "chatcmpl-ae8e9f07da25157e",
  "object": "chat.completion",
  "created": 1790318354,
  "model": "mistral-7b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Deep blue whisper\nSalt-kissed waves embrace\nEternal tide.",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [],
        "reasoning": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null,
      "token_ids": null,
      "routed_experts": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": "vllm-0.23.0-bfb893d8",
  "usage": {
    "prompt_tokens": 18,
    "total_tokens": 34,
    "completion_tokens": 16,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "prompt_token_ids": null,
  "prompt_text": null,
  "kv_transfer_params": null
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Must be mistral-7b.
messages*
OpenAI-style chat messages. Supports system, user, and assistant roles.
messages-1*
Maximum tokens to generate. Prompt plus max_tokens must fit the 6,144-token context window.
Sampling temperature.

About this endpoint

What it does

OpenAI-compatible chat completions using Ministral 7B. Send model ("mistral-7b"), a messages array (each item has role and content), and optionally max_tokens and temperature. Supports system, user, and assistant roles in any standard OpenAI conversation shape. Returns a single JSON response with the generated reply — no polling, no task ID.

Request Body

ParameterTypeMandatoryDescription
modelStringYesMust be mistral-7b.
messagesArrayYesList of {role, content} objects, OpenAI chat format. At least one message.
messages[].roleStringYessystem, user or assistant.
messages[].contentStringYesThe message text.
max_tokensIntegerNoMaximum tokens to generate. Default: 512. Prompt plus max_tokens must fit the 6,144-token context window.
temperatureNumberNoSampling temperature, 0–2. Default: 0.7.

Response

Returns a standard OpenAI chat completion object with the generated reply in choices[].message.content.

FieldTypeDescription
idStringCompletion id, e.g. chatcmpl-ae8e9f07da25157e.
objectStringAlways chat.completion.
createdIntegerUnix timestamp (seconds) of the completion.
modelStringModel used, mistral-7b.
choicesArrayGenerated replies (one item).
choices[].indexIntegerPosition of the choice, 0.
choices[].message.roleStringAlways assistant.
choices[].message.contentStringThe generated reply.
choices[].message.tool_callsArrayAlways empty; tool calling is not enabled.
choices[].finish_reasonStringstop (natural end) or length (hit max_tokens).
system_fingerprintStringServing-stack build id, e.g. vllm-0.23.0-bfb893d8.
usage.prompt_tokensIntegerTokens in the prompt.
usage.completion_tokensIntegerTokens generated.
usage.total_tokensIntegerSum of the two.

Notes

Response time is typically 1–3 seconds and scales with max_tokens. No messages history is stored server-side — send the full conversation each time. Context window is 6,144 tokens (prompt + output). Streaming (stream: true) is not supported on this endpoint.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.