# OpenAI-compatible API

> Chat with models on any server that takes OpenAI API requests at a Base URL you give, such as vLLM, LM Studio, NVIDIA NIM or an AI gateway, and list the models it serves.

App · 2 actions. Web page: https://docs.lodol.com/docs/integrations/openai-compatible

## Actions

### List models

List the models the server offers, with who owns each one.

**Inputs**: None.

**Outputs**

- `count` (number): How many models there are.
- `models` (list): The models, in the order the server lists them.

**Example output**

```json
{
  "count": 2,
  "models": [
    {
      "id": "openai/gpt-oss-120b",
      "owned_by": "vllm"
    },
    {
      "id": "Qwen/Qwen3-32B",
      "owned_by": "vllm"
    }
  ]
}
```

### Send a message

Send a message to a model on the server and get its answer, with an optional system prompt, or a JSON schema to get the answer back as data.

**Inputs**

- Model (`model`, text, required): The model to answer, as the server names it, such as openai/gpt-oss-120b. Pick one the server lists, or type its name.
- Prompt (`prompt`, text, required): What to ask or tell the model.
- System prompt (`system`, text): Instructions the model follows for the whole answer, such as its role or the format to answer in.
- Temperature (`temperature`, number): How varied the answer is, from 0 (the same answer every time) to 2. Leave empty for the server's own setting. From 0 to 2.0.
- Max tokens (`max_tokens`, number): The most tokens the model may write, its thinking included (about three quarters of a word each). Leave empty to let the server decide. At least 1.
- JSON schema (`json_schema`, text): A JSON schema the answer has to follow, pasted as JSON, such as {"type": "object", "properties": {"summary": {"type": "string"}}}. A later step then reads the answer's fields from json. Leave empty for an answer in plain text.

**Outputs**

- `finish_reason` (text): Why the model stopped: stop when it finished, length when it reached the maximum tokens.
- `json` (object): The answer read as JSON, usually a record with the fields the JSON schema names, when one was given; null without one.
- `model` (text): The model that answered, as the server names it.
- `text` (text): The model's answer.
- `thinking` (text): The model's reasoning before it answered, from a model that thinks first; null for one that doesn't.
- `usage` (object): The tokens the request took, as the server counts them; 0 where it doesn't say.

**Example output**

```json
{
  "finish_reason": "stop",
  "json": {
    "sentiment": "positive"
  },
  "model": "openai/gpt-oss-120b",
  "text": "{\"sentiment\": \"positive\"}",
  "thinking": null,
  "usage": {
    "input_tokens": 42,
    "output_tokens": 9
  }
}
```
