> ## Documentation Index
> Fetch the complete documentation index at: https://kiosapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# gpt-4-all: File Analysis, Vision, and Web Browsing

> Use gpt-4-all via POST /v1/chat/completions to analyse files, images, and web pages. Pass a public file URL in your message to trigger file analysis.

`gpt-4-all` is a special model variant built on the `gpt-4` core that supports file analysis and web browsing alongside standard chat. Like its `gpt-4o-all` counterpart, you include a file URL directly in your message content rather than uploading files separately — the model fetches the document and answers your question about it. Image analysis and real-time web search are also available in the same interface.

## Features

* **Image Analysis** — Pass an image URL directly in `content` to ask questions about the image.
* **File Analysis** — Pass a file URL followed by a space and your question; the model will download and interpret the file's contents.
* **Web Browsing** — Built-in web search capability lets the model pull in current information as part of its response.

## Request

**`POST https://kiosapi.com/v1/chat/completions`**

### Headers

| Header          | Required | Description        |
| --------------- | -------- | ------------------ |
| `Content-Type`  | Yes      | `application/json` |
| `Authorization` | Yes      | `Bearer sk-xxx`    |

### Request Body

<ParamField body="model" type="string" required>
  Must be `"gpt-4-all"` to access the file analysis and web browsing capabilities.
</ParamField>

<ParamField body="messages" type="array" required>
  An array of message objects representing the conversation.

  <Expandable title="messages[] properties">
    <ParamField body="messages[].role" type="string" required>
      The role of the message author. Accepted values are `"system"` and `"user"`.
    </ParamField>

    <ParamField body="messages[].content" type="string" required>
      The message text. To trigger file analysis, format this field as a file URL followed by a single space and then your question, for example: `"https://example.com/report.pdf Summarise the key findings."`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="temperature" type="number">
  Sampling temperature between `0` and `2`. Higher values produce more varied output; lower values produce more focused, deterministic output.
</ParamField>

<ParamField body="stream" type="boolean">
  Set to `true` to receive the response as a stream of server-sent events. Defaults to `false`.
</ParamField>

<ParamField body="max_tokens" type="number">
  The maximum number of tokens to generate in the response.
</ParamField>

### Example Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://kiosapi.com/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxx" \
      -d '{
        "model": "gpt-4-all",
        "messages": [
          {
            "role": "user",
            "content": "https://example.com/api-doc.pdf What is the API for adding a domain?"
          }
        ],
        "max_tokens": 1688,
        "temperature": 0.5,
        "stream": false
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import openai

    openai.api_key = "sk-xxx"
    openai.base_url = "https://kiosapi.com/v1/"

    response = openai.chat.completions.create(
        model="gpt-4-all",
        messages=[
            {
                "role": "user",
                "content": "https://example.com/api-doc.pdf What is the API for adding a domain?"
            }
        ],
        max_tokens=1688,
        temperature=0.5,
        stream=False
    )

    print(response.choices[0].message.content)
    ```
  </Tab>
</Tabs>

<Tip>
  For file analysis, the format is: **file URL + space + your question**. The model downloads the file at the URL you provide and answers based on its contents. Ensure the URL is publicly accessible before making the request.
</Tip>

## Response

The response follows the standard chat completions format.

```json theme={null}
{
  "id": "chatcmpl-EqJ6TxTZRW1sUgfFTbATPumIFWzCi",
  "object": "chat.completion",
  "created": 1724997805,
  "model": "gpt-4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Based on the document, the API for adding a domain is..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 292,
    "total_tokens": 305
  }
}
```

### Response Fields

<ResponseField name="choices[].message.content" type="string">
  The model's text response, which may include analysis drawn from the file or image you provided and any information retrieved via web browsing.
</ResponseField>

<ResponseField name="choices[].finish_reason" type="string">
  The reason generation stopped. Typically `"stop"` for a complete response.
</ResponseField>

<ResponseField name="usage" type="object">
  Token usage breakdown for the request, including `prompt_tokens`, `completion_tokens`, and `total_tokens`.
</ResponseField>
