Skip to content
Docs

Completions

Create a response

The OpenAI Responses format, on the same models and prices. It stores nothing: send the whole conversation in input every time. With "stream": true you get response.* events.

POST / v1 / responses
POST / v1 / responses

Create a response

The OpenAI Responses format, on the same models and prices. It stores nothing: send the whole conversation in input every time. With "stream": true you get response.* events.

Authorizations

Authorizationstring<bearer>required

Bearer authentication header of the form Bearer <token>, where <token> is your API key.

Your key stays in this page and is only sent with this request. Get an API key

Body

application/json

Up to 1,000 characters and 256 output tokens, to try the API. For more, use the API from your code, the Chat or an agent.

Create a response
curl --request POST \
  --url https://api.libremodel.ai/v1/responses \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "deepseek-v4.1-flash-1017",
  "input": "",
  "max_output_tokens": 256
}'
{
  "id": "resp_01a22df851fa7307be622e39f036499d",
  "object": "response",
  "created_at": 1796067578,
  "status": "completed",
  "model": "deepseek-v4.1-flash-1017",
  "output": [
    {
      "type": "message",
      "id": "msg_01a22df851fa7307",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "Hello! How can I help you today?",
          "annotations": []
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 9,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 10,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 19,
    "cost": 0.0000132
  },
  "error": null
}

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your API key.

Body

application/json
  • modelstringrequired

    A Libremodel model ID, from Models or GET /v1/models.

  • inputstring | object[]required

    Text, or the conversation as items: messages (with input_text, input_image and input_file), function_call and function_call_output.

  • instructionsstring

    The system prompt.

  • max_output_tokensinteger

    Cap on output tokens, reasoning included.

  • streambooleandefault: false

    Send the answer as Server-Sent Events, as it is generated. See Streaming.

  • reasoningobject

    effort: how much the model thinks. See Reasoning.

    Show child attributes
    • effortstring

      The level.

      Allowed values:"low""high""max""off"

  • toolsobject[]

    function tools. See Tool calling.

  • textobject

    format for structured outputs, and verbosity.

  • storeboolean

    Only false: true and previous_response_id return 400.

  • temperaturenumber

    Sampling temperature.

  • top_pnumber

    Nucleus sampling.

Response

application/json

The response. With stream, a text/event-stream instead.

  • idstringrequired

    The ID of the response.

  • objectstringrequired

    Always "response".

  • statusstringrequired

    completed, or incomplete when it reached the output cap.

  • modelstringrequired

    The model you asked for.

  • outputobject[]required

    The items of the answer: reasoning, message (with output_text) and function_call.

  • usageobjectrequired

    input_tokens, output_tokens with their details, and cost.

    Show child attributes
    • costnumberrequired

      What the request cost, in dollars.

      Example: 0.0001605