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

# OpenAI Multimodal Responses API

>  - Vollständig kompatibel mit dem Format der OpenAI Responses API
- Unterstützt multimodale Eingabe mit Text und Bildern
- Unterstützt Tool-Erweiterungen: Websuche, Dateisuche, Function Calling, Remote MCP 

<RequestExample>
  ```bash cURL theme={null}
  curl https://gccai.heqingsong.uk/v1/responses \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <token>" \
    -d '{
      "model": "gpt-5.2-pro",
      "input": [
        {
          "role": "user",
          "content": [
            {
              "type": "input_text",
              "text": "What is in this image?"
            },
            {
              "type": "input_image",
              "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
            }
          ]
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import requests
  import os

  url = "https://gccai.heqingsong.uk/v1/responses"

  payload = {
      "model": "gpt-5.2-pro",
      "input": [
          {
              "role": "user",
              "content": [
                  {
                      "type": "input_text",
                      "text": "What is in this image?"
                  },
                  {
                      "type": "input_image",
                      "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
                  }
              ]
          }
      ]
  }

  headers = {
      "Authorization": f"Bearer {os.environ.get('OPENAI_API_KEY')}",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://gccai.heqingsong.uk/v1/responses";

  const payload = {
    model: "gpt-5.2-pro",
    input: [
      {
        role: "user",
        content: [
          {
            type: "input_text",
            text: "What is in this image?"
          },
          {
            type: "input_image",
            image_url: "https://openai-documentation.vercel.app/images/cat_and_otter.png"
          }
        ]
      }
    ]
  };

  const headers = {
    "Authorization": `Bearer ${process.env.OPENAI_API_KEY}`,
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
      "os"
  )

  func main() {
      url := "https://gccai.heqingsong.uk/v1/responses"

      payload := map[string]interface{}{
          "model": "gpt-5.2-pro",
          "input": []map[string]interface{}{
              {
                  "role": "user",
                  "content": []map[string]string{
                      {
                          "type": "input_text",
                          "text": "What is in this image?",
                      },
                      {
                          "type":      "input_image",
                          "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png",
                      },
                  },
              },
          },
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer "+os.Getenv("OPENAI_API_KEY"))
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class Main {
      public static void main(String[] args) throws Exception {
          String url = "https://gccai.heqingsong.uk/v1/responses";
          String apiKey = System.getenv("OPENAI_API_KEY");

          String payload = """
          {
            "model": "gpt-5.2-pro",
            "input": [
              {
                "role": "user",
                "content": [
                  {
                    "type": "input_text",
                    "text": "What is in this image?"
                  },
                  {
                    "type": "input_image",
                    "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
                  }
                ]
              }
            ]
          }
          """;

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create(url))
              .header("Authorization", "Bearer " + apiKey)
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          HttpResponse<String> response = client.send(request,
              HttpResponse.BodyHandlers.ofString());

          System.out.println(response.body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://gccai.heqingsong.uk/v1/responses";
  $apiKey = getenv('OPENAI_API_KEY');

  $payload = [
      "model" => "gpt-5.2-pro",
      "input" => [
          [
              "role" => "user",
              "content" => [
                  [
                      "type" => "input_text",
                      "text" => "What is in this image?"
                  ],
                  [
                      "type" => "input_image",
                      "image_url" => "https://openai-documentation.vercel.app/images/cat_and_otter.png"
                  ]
              ]
          ]
      ]
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer " . $apiKey,
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://gccai.heqingsong.uk/v1/responses")
  api_key = ENV['OPENAI_API_KEY']

  payload = {
    model: "gpt-5.2-pro",
    input: [
      {
        role: "user",
        content: [
          {
            type: "input_text",
            text: "What is in this image?"
          },
          {
            type: "input_image",
            image_url: "https://openai-documentation.vercel.app/images/cat_and_otter.png"
          }
        ]
      }
    ]
  }

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(url)
  request["Authorization"] = "Bearer #{api_key}"
  request["Content-Type"] = "application/json"
  request.body = payload.to_json

  response = http.request(request)
  puts response.body
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://gccai.heqingsong.uk/v1/responses")!
  let apiKey = ProcessInfo.processInfo.environment["OPENAI_API_KEY"] ?? ""

  let payload: [String: Any] = [
      "model": "gpt-5.2-pro",
      "input": [
          [
              "role": "user",
              "content": [
                  [
                      "type": "input_text",
                      "text": "What is in this image?"
                  ],
                  [
                      "type": "input_image",
                      "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
                  ]
              ]
          ]
      ]
  ]

  var request = URLRequest(url: url)
  request.httpMethod = "POST"
  request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let error = error {
          print("Error: \(error)")
          return
      }

      if let data = data, let responseString = String(data: data, encoding: .utf8) {
          print(responseString)
      }
  }

  task.resume()
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          var url = "https://gccai.heqingsong.uk/v1/responses";
          var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");

          var payload = @"{
              ""model"": ""gpt-5.2-pro"",
              ""input"": [
                  {
                      ""role"": ""user"",
                      ""content"": [
                          {
                              ""type"": ""input_text"",
                              ""text"": ""What is in this image?""
                          },
                          {
                              ""type"": ""input_image"",
                              ""image_url"": ""https://openai-documentation.vercel.app/images/cat_and_otter.png""
                          }
                      ]
                  }
              ]
          }";

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");

          var content = new StringContent(payload, Encoding.UTF8, "application/json");
          var response = await client.PostAsync(url, content);
          var result = await response.Content.ReadAsStringAsync();

          Console.WriteLine(result);
      }
  }
  ```

  ```c C theme={null}
  #include <stdio.h>
  #include <curl/curl.h>
  #include <stdlib.h>

  int main(void) {
      CURL *curl;
      CURLcode res;
      const char *api_key = getenv("OPENAI_API_KEY");

      curl_global_init(CURL_GLOBAL_DEFAULT);
      curl = curl_easy_init();

      if(curl) {
          const char *url = "https://gccai.heqingsong.uk/v1/responses";
          const char *payload = "{"
              "\"model\":\"gpt-5.2-pro\","
              "\"input\":[{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is in this image?\"},{\"type\":\"input_image\",\"image_url\":\"https://openai-documentation.vercel.app/images/cat_and_otter.png\"}]}]"
          "}";

          char auth_header[256];
          snprintf(auth_header, sizeof(auth_header), "Authorization: Bearer %s", api_key);

          struct curl_slist *headers = NULL;
          headers = curl_slist_append(headers, auth_header);
          headers = curl_slist_append(headers, "Content-Type: application/json");

          curl_easy_setopt(curl, CURLOPT_URL, url);
          curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
          curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

          res = curl_easy_perform(curl);

          if(res != CURLE_OK) {
              fprintf(stderr, "curl_easy_perform() failed: %s\n",
                      curl_easy_strerror(res));
          }

          curl_slist_free_all(headers);
          curl_easy_cleanup(curl);
      }

      curl_global_cleanup();
      return 0;
  }
  ```

  ```objectivec Objective-C theme={null}
  #import <Foundation/Foundation.h>

  int main(int argc, const char * argv[]) {
      @autoreleasepool {
          NSURL *url = [NSURL URLWithString:@"https://gccai.heqingsong.uk/v1/responses"];
          NSString *apiKey = [NSProcessInfo processInfo].environment[@"OPENAI_API_KEY"];

          NSDictionary *payload = @{
              @"model": @"gpt-5.2-pro",
              @"input": @[
                  @{
                      @"role": @"user",
                      @"content": @[
                          @{
                              @"type": @"input_text",
                              @"text": @"What is in this image?"
                          },
                          @{
                              @"type": @"input_image",
                              @"image_url": @"https://openai-documentation.vercel.app/images/cat_and_otter.png"
                          }
                      ]
                  }
              ]
          };

          NSError *error;
          NSData *jsonData = [NSJSONSerialization dataWithJSONObject:payload
                                                            options:0
                                                              error:&error];

          NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
          [request setHTTPMethod:@"POST"];
          [request setValue:[NSString stringWithFormat:@"Bearer %@", apiKey]
              forHTTPHeaderField:@"Authorization"];
          [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
          [request setHTTPBody:jsonData];

          NSURLSessionDataTask *task = [[NSURLSession sharedSession]
              dataTaskWithRequest:request
              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                  if (error) {
                      NSLog(@"Error: %@", error);
                      return;
                  }
                  NSString *result = [[NSString alloc] initWithData:data
                                                          encoding:NSUTF8StringEncoding];
                  NSLog(@"%@", result);
              }];

          [task resume];
          [[NSRunLoop mainRunLoop] run];
      }
      return 0;
  }
  ```

  ```ocaml OCaml theme={null}
  (* Requires cohttp and yojson libraries *)
  open Lwt
  open Cohttp
  open Cohttp_lwt_unix

  let url = "https://gccai.heqingsong.uk/v1/responses"
  let api_key = Sys.getenv "OPENAI_API_KEY"

  let payload = {|{
    "model": "gpt-5.2-pro",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
          }
        ]
      }
    ]
  }|}

  let () =
    let headers = Header.init ()
      |> fun h -> Header.add h "Authorization" ("Bearer " ^ api_key)
      |> fun h -> Header.add h "Content-Type" "application/json"
    in
    let body = Cohttp_lwt.Body.of_string payload in

    let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) ->
      body |> Cohttp_lwt.Body.to_string >|= fun body_str ->
      print_endline body_str
    in
    Lwt_main.run response
  ```

  ```dart Dart theme={null}
  import 'dart:convert';
  import 'dart:io';
  import 'package:http/http.dart' as http;

  void main() async {
    final url = Uri.parse('https://gccai.heqingsong.uk/v1/responses');
    final apiKey = Platform.environment['OPENAI_API_KEY'];

    final payload = {
      'model': 'gpt-5.2-pro',
      'input': [
        {
          'role': 'user',
          'content': [
            {
              'type': 'input_text',
              'text': 'What is in this image?'
            },
            {
              'type': 'input_image',
              'image_url': 'https://openai-documentation.vercel.app/images/cat_and_otter.png'
            }
          ]
        }
      ]
    };

    final response = await http.post(
      url,
      headers: {
        'Authorization': 'Bearer $apiKey',
        'Content-Type': 'application/json',
      },
      body: jsonEncode(payload),
    );

    print(response.body);
  }
  ```

  ```r R theme={null}
  library(httr)
  library(jsonlite)

  url <- "https://gccai.heqingsong.uk/v1/responses"
  api_key <- Sys.getenv("OPENAI_API_KEY")

  payload <- list(
    model = "gpt-5.2-pro",
    input = list(
      list(
        role = "user",
        content = list(
          list(
            type = "input_text",
            text = "What is in this image?"
          ),
          list(
            type = "input_image",
            image_url = "https://openai-documentation.vercel.app/images/cat_and_otter.png"
          )
        )
      )
    )
  )

  response <- POST(
    url,
    add_headers(
      Authorization = paste("Bearer", api_key),
      `Content-Type` = "application/json"
    ),
    body = toJSON(payload, auto_unbox = TRUE),
    encode = "raw"
  )

  cat(content(response, "text"))
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": {
      "id": "resp-9876543210",
      "object": "response",
      "created": 1677652288,
      "model": "gpt-5.2-pro",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "This image shows a cat and an otter. They appear to be interacting with each other in a very cute and heartwarming scene. The cat and otter seem to be getting along well."
          },
          "finish_reason": "stop"
        }
      ],
      "usage": {
        "prompt_tokens": 156,
        "completion_tokens": 45,
        "total_tokens": 201
      }
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed, please check your API key",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance, please top up and try again",
      "type": "payment_required"
    }
  }
  ```

  ```json 403 theme={null}
  {
    "error": {
      "code": 403,
      "message": "Access forbidden, you do not have permission to access this resource",
      "type": "permission_error"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "Too many requests, please try again later",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "Internal server error, please try again later",
      "type": "server_error"
    }
  }
  ```

  ```json 502 theme={null}
  {
    "error": {
      "code": 502,
      "message": "Gateway error, server temporarily unavailable",
      "type": "bad_gateway"
    }
  }
  ```
</ResponseExample>

## Autorisierung

<ParamField header="Authorization" type="string" required>
  \##Alle APIs erfordern eine Bearer-Token-Authentifizierung##

  API-Key erhalten:

  Besuchen Sie die [Seite zur API-Key-Verwaltung](https://gccai.heqingsong.uk/keys), um Ihren API-Key zu erhalten

  Im Anfrage-Header hinzufügen:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required default="gpt-5.2-pro">
  Modellname

  Unterstützte Modelle umfassen:

  * `gpt-5.2-pro`
  * `gpt-5.2-codex`
  * Weitere Modelle folgen in Kürze ...
</ParamField>

<ParamField body="input" type="array" required>
  Liste der Eingabeinhalte

  Eingabe-Array, jedes Element enthält die Felder `role` und `content`.

  **💡 Schnellausfüllen (Try-it-Bereich):**

  1. Klicken Sie auf „+ Add an item", um ein Eingabeelement hinzuzufügen
  2. Eingabe `role`: `user` (Benutzernachricht), `assistant` (KI-Antwort) oder `system` (Systemanweisung)
  3. `content` Content-Blöcke hinzufügen (kann Text und Bilder enthalten)

  <Expandable title="Felddetails">
    <ParamField body="role" type="string" required default="user">
      Rollentyp

      Optionen: `user` (Benutzernachricht), `assistant` (KI-Antwort, für Mehrfach-Dialoge), `system` (Systemanweisung zur Festlegung des KI-Verhaltens)
    </ParamField>

    <ParamField body="content" type="array" required>
      Content-Array

      Unterstützt mehrere Arten von Content-Blöcken, kann Text und Bilder enthalten.

      <Expandable title="Content-Block-Typen">
        <ParamField body="type" type="string" required>
          Content-Typ

          Optionen:

          * `input_text`: Texteingabe
          * `input_image`: Bildeingabe
        </ParamField>

        <ParamField body="text" type="string">
          Textinhalt

          Wird verwendet, wenn `type` `input_text` ist; geben Sie hier den Textinhalt ein
        </ParamField>

        <ParamField body="image_url" type="string">
          Bild-URL

          Wird verwendet, wenn `type` `input_image` ist; geben Sie die Bild-URL oder Base64-Codierung an

          Unterstützt zwei Formate:

          **1. Vollständige Bild-URL**

          * Öffentlich zugängliche Bild-URL (http\:// oder https\://)
          * Beispiel: `https://example.com/image.jpg`

          **2. Base64-codiertes Format**

          * **Es muss das vollständige Data-URI-Format verwendet werden**
          * Format: `data:image/{format};base64,{base64_data}`
          * Unterstützte Bildformate: jpeg, png, gif, webp
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="temperature" type="number">
  Steuert die Zufälligkeit der Ausgabe, Bereich 0–2

  * Niedrigere Werte (z. B. 0.2) führen zu deterministischerer Ausgabe
  * Höhere Werte (z. B. 1.8) führen zu zufälligerer Ausgabe

  Standard: 1.0
</ParamField>

<ParamField body="max_tokens" type="integer">
  Maximale Anzahl der zu generierenden Tokens

  Verschiedene Modelle haben unterschiedliche maximale Grenzwerte, bitte beachten Sie die jeweilige Modelldokumentation
</ParamField>

<ParamField body="stream" type="boolean">
  Ob Streaming-Ausgabe verwendet werden soll

  * `true`: Streaming-Antwort (SSE-Format)
  * `false`: vollständige Antwort auf einmal zurückgeben

  Standard: false
</ParamField>

<ParamField body="top_p" type="number">
  Nucleus-Sampling-Parameter, Bereich 0–1

  Steuert die Vielfalt des generierten Texts, empfohlen als Alternative zu temperature

  Standard: 1.0
</ParamField>

<ParamField body="tools" type="array">
  Tool-Liste zur Erweiterung der Modellfähigkeiten

  Unterstützte Tool-Typen:

  * **Websuche** (`web_search`): Echtzeit-Suche nach Internet-Informationen
  * **Dateisuche** (`file_search`): Suche im Inhalt hochgeladener Dateien
  * **Function Calling** (`function`): Aufruf benutzerdefinierter Funktionen
  * **Remote MCP** (`remote_mcp`): Verbindung zu Remote-Diensten des Model Context Protocol

  Beispiel: `[{"type": "web_search"}]`
</ParamField>

## Response

<ResponseField name="id" type="string">
  Eindeutiger Identifikator der Antwort
</ResponseField>

<ResponseField name="object" type="string">
  Objekttyp, fest `response`
</ResponseField>

<ResponseField name="created" type="integer">
  Zeitstempel der Erstellung
</ResponseField>

<ResponseField name="model" type="string">
  Der tatsächlich verwendete Modellname
</ResponseField>

<ResponseField name="choices" type="array">
  Liste der generierten Antworten

  <Expandable title="Eigenschaften">
    <ResponseField name="index" type="integer">
      Index der Auswahl
    </ResponseField>

    <ResponseField name="message" type="object">
      Nachrichteninhalt

      <Expandable title="Eigenschaften">
        <ResponseField name="role" type="string">
          Rollentyp (assistant)
        </ResponseField>

        <ResponseField name="content" type="string">
          Generierter Textinhalt
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="finish_reason" type="string">
      Grund für den Abschluss

      Mögliche Werte:

      * `stop` – natürlicher Abschluss
      * `length` – maximale Länge erreicht
      * `content_filter` – Inhaltsfilterung
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="usage" type="object">
  Statistik zur Token-Nutzung

  <Expandable title="Eigenschaften">
    <ResponseField name="prompt_tokens" type="integer">
      Anzahl der Tokens in der Eingabe
    </ResponseField>

    <ResponseField name="completion_tokens" type="integer">
      Anzahl der Tokens in der Ausgabe
    </ResponseField>

    <ResponseField name="total_tokens" type="integer">
      Gesamtzahl der Tokens
    </ResponseField>
  </Expandable>
</ResponseField>

## Anwendungsbeispiele

### Nur-Text-Eingabe

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Hello, introduce artificial intelligence"
        }
      ]
    }
  ]
}
```

### Verwendung des Websuche-Tools

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "tools": [{"type": "web_search"}],
  "input": "What positive news is there today?"
}
```

```bash cURL Example theme={null}
curl "https://gccai.heqingsong.uk/v1/responses" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <token>" \
    -d '{
        "model": "gpt-5.2-pro",
        "tools": [{"type": "web_search"}],
        "input": "What positive news is there today?"
    }'
```

### Bildverständnis

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Describe this image"
        },
        {
          "type": "input_image",
          "image_url": "https://example.com/image.jpg"
        }
      ]
    }
  ]
}
```

### Analyse mehrerer Bilder

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Compare the similarities and differences of these two images"
        },
        {
          "type": "input_image",
          "image_url": "https://example.com/image1.jpg"
        },
        {
          "type": "input_image",
          "image_url": "https://example.com/image2.jpg"
        }
      ]
    }
  ]
}
```

### Base64-codiertes Bild

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Analyze this image"
        },
        {
          "type": "input_image",
          "image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
        }
      ]
    }
  ]
}
```

### Verwendung des Dateisuche-Tools

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "tools": [{"type": "file_search"}],
  "input": "Based on uploaded documents, summarize the company's quarterly performance"
}
```

### Verwendung von Function Calling

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get weather information for a specified city",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "description": "City name, e.g.: Beijing"
            },
            "unit": {
              "type": "string",
              "enum": ["celsius", "fahrenheit"],
              "description": "Temperature unit"
            }
          },
          "required": ["city"]
        }
      }
    }
  ],
  "input": "What's the weather like in Beijing today?"
}
```

### Verwendung von Remote MCP

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "tools": [
    {
      "type": "remote_mcp",
      "remote_mcp": {
        "url": "https://mcp.example.com/api",
        "auth_token": "your_mcp_token"
      }
    }
  ],
  "input": "Query user information in the database"
}
```

### Kombination mehrerer Tools

```json theme={null}
{
  "model": "gpt-5.2-pro",
  "tools": [
    {"type": "web_search"},
    {"type": "file_search"},
    {
      "type": "function",
      "function": {
        "name": "calculate",
        "description": "Perform mathematical calculations",
        "parameters": {
          "type": "object",
          "properties": {
            "expression": {
              "type": "string",
              "description": "Mathematical expression"
            }
          },
          "required": ["expression"]
        }
      }
    }
  ],
  "input": "Search for the latest Bitcoin price and calculate the total value of 100 Bitcoins"
}
```

## Spezifikationen der Content-Typen

### input\_text

Texteingabe-Typ

**Eigenschaften:**

* `type`: fest `"input_text"`
* `text`: Textinhalt (String)

### input\_image

Bildeingabe-Typ

**Eigenschaften:**

* `type`: fest `"input_image"`
* `image_url`: Bild-URL oder Base64-codiertes Data-URI

**Unterstützte Bildformate:**

* JPEG
* PNG
* GIF
* WebP

**Größenbeschränkungen für Bilder:**

* Maximale Dateigröße: 20 MB
* Empfohlenes Seitenverhältnis: nicht mehr als 2048x2048 Pixel

## Details zur Tool-Nutzung

### Websuche

Das Websuche-Tool ermöglicht es dem Modell, in Echtzeit auf Internet-Informationen zuzugreifen.

**Konfigurationsbeispiel:**

```json theme={null}
{
  "tools": [{"type": "web_search"}]
}
```

**Anwendungsfälle:**

* Abruf der neuesten Nachrichten und aktuellen Ereignisse
* Echtzeit-Daten erhalten (Aktien, Wetter, Wechselkurse usw.)
* Suche nach aktueller technischer Dokumentation
* Überprüfung von Faktinformationen

### Dateisuche

Das Dateisuche-Tool ermöglicht es dem Modell, relevante Informationen in hochgeladenen Dokumenten zu suchen.

**Konfigurationsbeispiel:**

```json theme={null}
{
  "tools": [{"type": "file_search"}]
}
```

**Anwendungsfälle:**

* Analyse interner Unternehmensdokumente
* Suche in technischen Spezifikationen und Handbüchern
* Abfragen zu Verträgen und Rechtsdokumenten
* Q\&A-Systeme auf Wissensbasis

### Function Calling

Definieren Sie benutzerdefinierte Funktionen, damit das Modell externe APIs aufrufen oder bestimmte Operationen ausführen kann.

**Vollständiges Konfigurationsbeispiel:**

```json theme={null}
{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_stock_price",
        "description": "Get real-time stock price",
        "parameters": {
          "type": "object",
          "properties": {
            "symbol": {
              "type": "string",
              "description": "Stock symbol, e.g.: AAPL"
            },
            "currency": {
              "type": "string",
              "enum": ["USD", "CNY"],
              "description": "Currency unit",
              "default": "USD"
            }
          },
          "required": ["symbol"]
        }
      }
    }
  ]
}
```

**Parameterbeschreibungen:**

* `name`: Funktionsname (erforderlich)
* `description`: Funktionsbeschreibung (erforderlich)
* `parameters`: Parameterdefinition im JSON-Schema-Format
  * `type`: Parametertyp
  * `properties`: Definitionen der Parametereigenschaften
  * `required`: Liste der erforderlichen Parameter

**Anwendungsfälle:**

* Aufruf von Drittanbieter-APIs
* Ausführen von Datenbankabfragen
* Auslösen von Geschäftsprozessen
* Integration mit internen Systemen

### Remote MCP

Verbindung zu Remote-Diensten des Model Context Protocol (MCP) zur Erweiterung der Modellfähigkeiten.

**Konfigurationsbeispiel:**

```json theme={null}
{
  "tools": [
    {
      "type": "remote_mcp",
      "remote_mcp": {
        "url": "https://your-mcp-server.com/api",
        "auth_token": "your_auth_token",
        "timeout": 30
      }
    }
  ]
}
```

**Parameterbeschreibungen:**

* `url`: MCP-Serveradresse (erforderlich)
* `auth_token`: Authentifizierungs-Token (optional)
* `timeout`: Timeout in Sekunden, Standard 30 Sekunden

**Anwendungsfälle:**

* Verbindung zu KI-Diensten auf Enterprise-Ebene
* Verwendung domänenspezifischer Modelle
* Zugriff auf geschützte Datenquellen
* Integration verteilter KI-Systeme

## Antwortformat bei Tool-Nutzung

Wenn das Modell Tools verwendet, enthält das Antwortformat Informationen zum Tool-Aufruf:

```json theme={null}
{
  "id": "resp-123456",
  "object": "response",
  "created": 1677652288,
  "model": "gpt-5.2-pro",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "tool_calls": [
          {
            "id": "call_abc123",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"city\": \"Beijing\"}"
            }
          }
        ]
      },
      "finish_reason": "tool_calls"
    }
  ]
}
```

**Ablauf eines Tool-Aufrufs:**

1. Modell erhält Benutzereingabe
2. Analysiert, ob Tools benötigt werden
3. Falls ja, gibt eine Tool-Aufrufanforderung zurück
4. Client führt den Tool-Aufruf aus
5. Gibt die Tool-Ergebnisse an das Modell zurück
6. Modell generiert die endgültige Antwort

## Wichtige Hinweise

1. **Anforderungen an Bild-URLs**:
   * Muss eine öffentlich zugängliche URL sein
   * Oder im Base64-codierten Data-URI-Format

2. **Token-Abrechnung**:
   * Bilder verbrauchen Tokens entsprechend ihrer Auflösung
   * Bilder mit hoher Auflösung werden automatisch verkleinert, um Kosten zu optimieren
   * Tool-Aufrufe verbrauchen ebenfalls zusätzliche Tokens

3. **Reihenfolge des Inhalts**:
   * Die Reihenfolge der Elemente im content-Array beeinflusst das Verständnis des Modells
   * Empfohlen, Textanweisungen zuerst zu platzieren, dann Bilder

4. **Multimodale Kombinationen**:
   * In einer Anfrage können mehrere Texte und Bilder gemischt werden
   * Mehrfach-Dialoge mit Kontext-Kohärenz werden unterstützt

5. **Einschränkungen der Tool-Nutzung**:
   * Bei gleichzeitiger Verwendung mehrerer Tools wählt das Modell intelligent das am besten geeignete Tool aus
   * Function Calling erfordert klare Funktionsdefinitionen und Parameterbeschreibungen
   * Ergebnisse der Websuche können regional und zeitlich begrenzt sein

6. **API-Kompatibilität**:
   * Vollständig kompatibel mit dem Format der OpenAI Responses API
   * Nahtlose Migration bestehenden OpenAI-Codes
   * Unterstützt alle Tool-Erweiterungsfunktionen von OpenAI
