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

# Erste Schritte

In wenigen Minuten mit der Venice API einsatzbereit. Generieren Sie einen API-Schlüssel, stellen Sie Ihre erste Anfrage und starten Sie mit dem Bauen.

## Quickstart

<Steps>
  <Step title="API-Schlüssel erhalten">
    Gehen Sie zu Ihren [Venice-API-Einstellungen](https://venice.ai/settings/api) und generieren Sie einen neuen API-Schlüssel.

    Für eine ausführliche Anleitung siehe den [API-Schlüssel-Leitfaden](/guides/getting-started/generating-api-key).
  </Step>

  <Step title="API-Schlüssel einrichten">
    Fügen Sie Ihren API-Schlüssel Ihrer Umgebung hinzu. Sie können ihn in Ihrer Shell exportieren:

    ```bash theme={"system"}
    export VENICE_API_KEY='your-api-key-here'
    ```

    Oder fügen Sie ihn zu einer `.env`-Datei in Ihrem Projekt hinzu:

    ```bash theme={"system"}
    VENICE_API_KEY=your-api-key-here
    ```
  </Step>

  <Step title="SDK installieren">
    Venice ist OpenAI-kompatibel, sodass Sie das OpenAI-SDK verwenden können. Wenn Sie lieber cURL oder rohe HTTP-Anfragen verwenden, können Sie diesen Schritt überspringen.

    <CodeGroup>
      ```bash Python theme={"system"}
      pip install openai
      ```

      ```bash Node.js theme={"system"}
      npm install openai
      ```
    </CodeGroup>
  </Step>

  <Step title="Ihre erste Anfrage senden">
    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import OpenAI

      client = OpenAI(
          api_key=os.getenv("VENICE_API_KEY"),
          base_url="https://api.venice.ai/api/v1"
      )

      completion = client.chat.completions.create(
          model="zai-org-glm-5",
          messages=[
              {"role": "system", "content": "You are a helpful AI assistant"},
              {"role": "user", "content": "Why is privacy important?"}
          ]
      )

      print(completion.choices[0].message.content)
      ```

      ```javascript Node.js theme={"system"}
      import OpenAI from 'openai';

      const client = new OpenAI({
          apiKey: process.env.VENICE_API_KEY,
          baseURL: 'https://api.venice.ai/api/v1'
      });

      const completion = await client.chat.completions.create({
          model: 'zai-org-glm-5',
          messages: [
              { role: 'system', content: 'You are a helpful AI assistant' },
              { role: 'user', content: 'Why is privacy important?' }
          ]
      });

      console.log(completion.choices[0].message.content);
      ```

      ```bash cURL theme={"system"}
      curl https://api.venice.ai/api/v1/chat/completions \
        -H "Authorization: Bearer $VENICE_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org-glm-5",
          "messages": [
            {"role": "system", "content": "You are a helpful AI assistant"},
            {"role": "user", "content": "Why is privacy important?"}
          ]
        }'
      ```
    </CodeGroup>

    **Nachrichtenrollen:**

    * `system` - Anweisungen für das Verhalten des Modells
    * `user` - Ihre Prompts oder Fragen
    * `assistant` - Frühere Modellantworten (für mehrstufige Konversationen)
    * `tool` - Function-Calling-Ergebnisse (bei Verwendung von Tools)
  </Step>

  <Step title="Modelle wechseln durch Ändern der Modell-ID">
    Jede Anfrage enthält eine `model`-ID. Um ein anderes Modell zu verwenden, ändern Sie den Wert `model` in Ihrer Anfrage. Beliebte Optionen:

    * `zai-org-glm-5` - Standardmodell für die meisten Use Cases
    * `kimi-k2-6` - Starkes Reasoning für komplexere Aufgaben
    * `claude-opus-4-8` - High-Intelligence-Modell für komplexe Aufgaben
    * `venice-uncensored-1-2` - Venice's unzensiertes Modell

    <Card title="Alle Modelle ansehen" icon="database" href="/overview/models">
      Durchsuchen Sie die vollständige Liste der Modelle mit Preisen, Capabilities und Kontextlimits
    </Card>
  </Step>

  <Step title="Venice-Parameter verwenden">
    Sie können Venice-spezifische Funktionen wie Web Search über `venice_parameters` aktivieren:

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import OpenAI

      client = OpenAI(
          api_key=os.environ.get("VENICE_API_KEY"),
          base_url="https://api.venice.ai/api/v1"
      )

      completion = client.chat.completions.create(
          model="zai-org-glm-5",
          messages=[
              {"role": "user", "content": "What are the latest developments in AI?"}
          ],
          extra_body={
              "venice_parameters": {
                  "enable_web_search": "auto",
                  "include_venice_system_prompt": True
              }
          }
      )

      print(completion.choices[0].message.content)
      ```

      ```javascript Node.js theme={"system"}
      import OpenAI from 'openai';

      const client = new OpenAI({
          apiKey: process.env.VENICE_API_KEY,
          baseURL: 'https://api.venice.ai/api/v1'
      });

      const completion = await client.chat.completions.create({
          model: 'zai-org-glm-5',
          messages: [
              { role: 'user', content: 'What are the latest developments in AI?' }
          ],
          venice_parameters: {
              enable_web_search: 'auto',
              include_venice_system_prompt: true
          }
      });

      console.log(completion.choices[0].message.content);
      ```

      ```bash cURL theme={"system"}
      curl https://api.venice.ai/api/v1/chat/completions \
        -H "Authorization: Bearer $VENICE_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org-glm-5",
          "messages": [
            {"role": "user", "content": "What are the latest developments in AI?"}
          ],
          "venice_parameters": {
            "enable_web_search": "auto",
            "include_venice_system_prompt": true
          }
        }'
      ```
    </CodeGroup>

    Siehe alle [verfügbaren Parameter](https://docs.venice.ai/api-reference/api-spec#venice-parameters).
  </Step>

  <Step title="Streaming aktivieren (optional)">
    Streamen Sie Antworten in Echtzeit mit `stream=True`:

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import OpenAI

      client = OpenAI(
          api_key=os.environ.get("VENICE_API_KEY"),
          base_url="https://api.venice.ai/api/v1"
      )

      stream = client.chat.completions.create(
          model="zai-org-glm-5",
          messages=[{"role": "user", "content": "Write a short story about AI"}],
          stream=True
      )

      for chunk in stream:
          if chunk.choices and chunk.choices[0].delta.content is not None:
              print(chunk.choices[0].delta.content, end="")
      ```

      ```javascript Node.js theme={"system"}
      import OpenAI from 'openai';

      const client = new OpenAI({
          apiKey: process.env.VENICE_API_KEY,
          baseURL: 'https://api.venice.ai/api/v1'
      });

      const stream = await client.chat.completions.create({
          model: 'zai-org-glm-5',
          messages: [{ role: 'user', content: 'Write a short story about AI' }],
          stream: true
      });

      for await (const chunk of stream) {
          if (chunk.choices && chunk.choices[0]?.delta?.content) {
              process.stdout.write(chunk.choices[0].delta.content);
          }
      }
      ```

      ```bash cURL theme={"system"}
      curl https://api.venice.ai/api/v1/chat/completions \
        -H "Authorization: Bearer $VENICE_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org-glm-5",
          "messages": [
            {"role": "user", "content": "Write a short story about AI"}
          ],
          "stream": true
        }'
      ```
    </CodeGroup>
  </Step>

  <Step title="Antwortverhalten anpassen (optional)">
    Steuern Sie das Antwortverhalten des Modells mit Parametern wie temperature, max tokens und mehr:

    <CodeGroup>
      ```python Python theme={"system"}
      import os
      from openai import OpenAI

      client = OpenAI(
          api_key=os.environ.get("VENICE_API_KEY"),
          base_url="https://api.venice.ai/api/v1"
      )

      completion = client.chat.completions.create(
          model="zai-org-glm-5",
          messages=[
              {"role": "system", "content": "You are a creative storyteller"},
              {"role": "user", "content": "Tell me a creative story"}
          ],
          temperature=0.8,
          max_tokens=500,
          top_p=0.9,
          frequency_penalty=0.5,
          presence_penalty=0.5,
          extra_body={
              "venice_parameters": {
                  "include_venice_system_prompt": False
              }
          }
      )

      print(completion.choices[0].message.content)
      ```

      ```javascript Node.js theme={"system"}
      import OpenAI from 'openai';

      const client = new OpenAI({
          apiKey: process.env.VENICE_API_KEY,
          baseURL: 'https://api.venice.ai/api/v1'
      });

      const completion = await client.chat.completions.create({
          model: 'zai-org-glm-5',
          messages: [
              { role: 'system', content: 'You are a creative storyteller' },
              { role: 'user', content: 'Tell me a creative story' }
          ],
          temperature: 0.8,
          max_tokens: 500,
          top_p: 0.9,
          frequency_penalty: 0.5,
          presence_penalty: 0.5,
          venice_parameters: {
              include_venice_system_prompt: false
          }
      });

      console.log(completion.choices[0].message.content);
      ```

      ```bash cURL theme={"system"}
      curl https://api.venice.ai/api/v1/chat/completions \
        -H "Authorization: Bearer $VENICE_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org-glm-5",
          "messages": [
            {"role": "system", "content": "You are a creative storyteller"},
            {"role": "user", "content": "Tell me a creative story"}
          ],
          "temperature": 0.8,
          "max_tokens": 500,
          "top_p": 0.9,
          "frequency_penalty": 0.5,
          "presence_penalty": 0.5,
          "stream": false,
          "venice_parameters": {
            "include_venice_system_prompt": false
          }
        }'
      ```
    </CodeGroup>

    Weitere Informationen zu allen unterstützten Parametern finden Sie in der [Chat-Completions-Dokumentation](/api-reference/endpoint/chat/completions).
  </Step>
</Steps>

***

## Weitere Funktionen

### Bildgenerierung

Erstellen Sie Bilder aus Text-Prompts mit Diffusion-Modellen:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests

  url = "https://api.venice.ai/api/v1/image/generate"

  payload = {
      "model": "venice-sd35",
      "prompt": "A cyberpunk city with neon lights and rain",
      "width": 1024,
      "height": 1024,
      "format": "webp"
  }

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

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

  print(response.json())
  ```

  ```javascript Node.js theme={"system"}
  const url = 'https://api.venice.ai/api/v1/image/generate';

  const options = {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          model: 'venice-sd35',
          prompt: 'A cyberpunk city with neon lights and rain',
          width: 1024,
          height: 1024,
          format: 'webp'
      })
  };

  try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
  } catch (error) {
      console.error(error);
  }
  ```

  ```bash cURL theme={"system"}
  curl https://api.venice.ai/api/v1/image/generate \
    -H "Authorization: Bearer $VENICE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "venice-sd35",
      "prompt": "A cyberpunk city with neon lights and rain",
      "width": 1024,
      "height": 1024
    }'
  ```
</CodeGroup>

**Hinweis:** Die Antwort enthält base64-kodierte Bilder im `images`-Array. Dekodieren Sie den base64-String, um das Bild zu speichern oder anzuzeigen.

**Beliebte Bildmodelle:**

* `qwen-image` - Höchste Qualität bei der Bildgenerierung
* `venice-sd35` - Standardwahl, funktioniert mit allen Funktionen
* `hidream` - Schnelle Generierung für den Produktiveinsatz

<Card title="Alle Bildmodelle ansehen" icon="image" href="/overview/models#image-models">
  Sehen Sie alle verfügbaren Bildmodelle mit Preisen und Capabilities
</Card>

Für erweiterte Parameter-Optionen wie `cfg_scale`, `negative_prompt`, `style_preset`, `seed`, `variants` und mehr siehe die [Images-API-Referenz](/api-reference/endpoint/image/generate).

### Bildbearbeitung

Modifizieren Sie vorhandene Bilder mit KI-gestütztem Inpainting unter Verwendung des Qwen-Image-Modells:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests
  import base64

  url = "https://api.venice.ai/api/v1/image/edit"

  with open("image.jpg", "rb") as f:
      image_base64 = base64.b64encode(f.read()).decode('utf-8')

  payload = {
      "prompt": "Colorize",
      "image": image_base64
  }

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

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

  with open("edited_image.png", "wb") as f:
      f.write(response.content)
  ```

  ```javascript Node.js theme={"system"}
  import fs from 'fs';

  const imageBuffer = fs.readFileSync('image.jpg');
  const imageBase64 = imageBuffer.toString('base64');

  const options = {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          prompt: 'Colorize',
          image: imageBase64
      })
  };

  const response = await fetch('https://api.venice.ai/api/v1/image/edit', options);
  const imageData = await response.arrayBuffer();
  fs.writeFileSync('edited_image.png', Buffer.from(imageData));
  ```

  ```bash cURL theme={"system"}
  curl --request POST \
    --url https://api.venice.ai/api/v1/image/edit \
    --header "Authorization: Bearer $VENICE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "prompt": "Colorize",
      "image": "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A..."
    }'
  ```
</CodeGroup>

**Hinweis:** Der Image-Editor verwendet das Qwen-Image-Modell und ist ein experimenteller Endpoint. Senden Sie das Eingabebild als base64-kodierten String, und die API gibt das bearbeitete Bild als Binärdaten zurück.

Alle Parameter siehe die [Image-Edit-API](/api-reference/endpoint/image/edit).

### Bild-Upscaling

Verbessern und skalieren Sie Bilder auf höhere Auflösungen:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests
  import base64

  url = "https://api.venice.ai/api/v1/image/upscale"

  with open("image.jpg", "rb") as f:
      image_base64 = base64.b64encode(f.read()).decode('utf-8')

  payload = {
      "image": image_base64,
      "scale": 2
  }

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

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

  with open("upscaled_image.png", "wb") as f:
      f.write(response.content)
  ```

  ```javascript Node.js theme={"system"}
  import fs from 'fs';

  const imageBuffer = fs.readFileSync('image.jpg');
  const imageBase64 = imageBuffer.toString('base64');

  const options = {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          image: imageBase64,
          scale: 2
      })
  };

  const response = await fetch('https://api.venice.ai/api/v1/image/upscale', options);
  const imageData = await response.arrayBuffer();
  fs.writeFileSync('upscaled_image.png', Buffer.from(imageData));
  ```

  ```bash cURL theme={"system"}
  curl --request POST \
    --url https://api.venice.ai/api/v1/image/upscale \
    --header "Authorization: Bearer $VENICE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "image": "iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAAAIGNIUk0A...",
      "scale": 2
    }'
  ```
</CodeGroup>

**Hinweis:** Senden Sie das Eingabebild als base64-kodierten String, und die API gibt das hochskalierte Bild als Binärdaten zurück.

Alle Parameter siehe die [Image-Upscale-API](/api-reference/endpoint/image/upscale).

### Text-to-Speech

Wandeln Sie Text in Audio mit mehr als 50 mehrsprachigen Stimmen um:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests

  response = requests.post(
      "https://api.venice.ai/api/v1/audio/speech",
      headers={
          "Authorization": f"Bearer {os.getenv('VENICE_API_KEY')}",
          "Content-Type": "application/json"
      },
      json={
          "input": "Hello, welcome to Venice Voice.",
          "model": "tts-kokoro",
          "voice": "af_sky"
      }
  )

  with open("speech.mp3", "wb") as f:
      f.write(response.content)
  ```

  ```javascript Node.js theme={"system"}
  import fs from 'fs';

  const response = await fetch('https://api.venice.ai/api/v1/audio/speech', {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          input: 'Hello, welcome to Venice Voice.',
          model: 'tts-kokoro',
          voice: 'af_sky'
      })
  });

  const audioBuffer = await response.arrayBuffer();
  fs.writeFileSync('speech.mp3', Buffer.from(audioBuffer));
  ```

  ```bash cURL theme={"system"}
  curl --request POST \
    --url https://api.venice.ai/api/v1/audio/speech \
    --header "Authorization: Bearer $VENICE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "input": "Hello, welcome to Venice Voice.",
      "model": "tts-kokoro",
      "voice": "af_sky"
    }' \
    --output speech.mp3
  ```
</CodeGroup>

Das `tts-kokoro`-Modell unterstützt mehr als 50 mehrsprachige Stimmen, einschließlich `af_sky`, `af_nova`, `am_liam`, `bf_emma`, `zf_xiaobei` und `jm_kumo`.

Alle Stimm-Optionen siehe die [TTS-API](/api-reference/endpoint/audio/speech).

### Speech-to-Text

Transkribieren Sie Audiodateien zu Text:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests

  url = "https://api.venice.ai/api/v1/audio/transcriptions"

  with open("audio.mp3", "rb") as f:
      response = requests.post(
          url,
          headers={"Authorization": f"Bearer {os.getenv('VENICE_API_KEY')}"},
          files={"file": f},
          data={
              "model": "nvidia/parakeet-tdt-0.6b-v3",
              "response_format": "json"
          }
      )

  print(response.json())
  ```

  ```javascript Node.js theme={"system"}
  import fs from 'fs';
  import FormData from 'form-data';

  const form = new FormData();
  form.append('file', fs.createReadStream('audio.mp3'));
  form.append('model', 'nvidia/parakeet-tdt-0.6b-v3');
  form.append('response_format', 'json');

  const response = await fetch('https://api.venice.ai/api/v1/audio/transcriptions', {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          ...form.getHeaders()
      },
      body: form
  });

  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={"system"}
  curl --request POST \
    --url https://api.venice.ai/api/v1/audio/transcriptions \
    --header "Authorization: Bearer $VENICE_API_KEY" \
    --form file=@audio.mp3 \
    --form model=nvidia/parakeet-tdt-0.6b-v3 \
    --form response_format=json
  ```
</CodeGroup>

Unterstützte Formate: WAV, FLAC, MP3, M4A, AAC, MP4. Aktivieren Sie `timestamps=true`, um Timing-Daten auf Wort-Ebene zu erhalten.

Alle Optionen siehe die [Transcriptions-API](/api-reference/endpoint/audio/transcriptions).

### Embeddings

Generieren Sie Vektor-Embeddings für semantische Suche, RAG und Empfehlungen:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  import requests

  url = "https://api.venice.ai/api/v1/embeddings"

  payload = {
      "model": "text-embedding-bge-m3",
      "input": "Privacy-first AI infrastructure for semantic search",
      "encoding_format": "float"
  }

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

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

  print(response.json())
  ```

  ```javascript Node.js theme={"system"}
  const url = 'https://api.venice.ai/api/v1/embeddings';

  const options = {
      method: 'POST',
      headers: {
          'Authorization': `Bearer ${process.env.VENICE_API_KEY}`,
          'Content-Type': 'application/json'
      },
      body: JSON.stringify({
          model: 'text-embedding-bge-m3',
          input: 'Privacy-first AI infrastructure for semantic search',
          encoding_format: 'float'
      })
  };

  try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
  } catch (error) {
      console.error(error);
  }
  ```

  ```bash cURL theme={"system"}
  curl --request POST \
    --url https://api.venice.ai/api/v1/embeddings \
    --header "Authorization: Bearer $VENICE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "model": "text-embedding-bge-m3",
      "input": "Privacy-first AI infrastructure for semantic search",
      "encoding_format": "float"
    }'
  ```
</CodeGroup>

Batch-Verarbeitung und erweiterte Optionen siehe die [Embeddings-API](/api-reference/endpoint/embeddings/generate).

### Vision (Multimodal)

Analysieren Sie Bilder gemeinsam mit Text mit vision-fähigen Modellen wie `qwen3-vl-235b-a22b`:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.getenv("VENICE_API_KEY"),
      base_url="https://api.venice.ai/api/v1"
  )

  response = client.chat.completions.create(
      model="qwen3-vl-235b-a22b",
      messages=[
          {
              "role": "user",
              "content": [
                  {"type": "text", "text": "What is in this image?"},
                  {
                      "type": "image_url",
                      "image_url": {"url": "https://www.gstatic.com/webp/gallery/1.jpg"}
                  }
              ]
          }
      ]
  )

  print(response.choices[0].message.content)
  ```

  ```javascript Node.js theme={"system"}
  import OpenAI from 'openai';

  const client = new OpenAI({
      apiKey: process.env.VENICE_API_KEY,
      baseURL: 'https://api.venice.ai/api/v1'
  });

  const response = await client.chat.completions.create({
      model: 'qwen3-vl-235b-a22b',
      messages: [
          {
              role: 'user',
              content: [
                  { type: 'text', text: 'What is in this image?' },
                  {
                      type: 'image_url',
                      image_url: { url: 'https://www.gstatic.com/webp/gallery/1.jpg' }
                  }
              ]
          }
      ]
  });

  console.log(response.choices[0].message.content);
  ```

  ```bash cURL theme={"system"}
  curl https://api.venice.ai/api/v1/chat/completions \
    -H "Authorization: Bearer $VENICE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "qwen3-vl-235b-a22b",
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "What is in this image?"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://www.gstatic.com/webp/gallery/1.jpg"
              }
            }
          ]
        }
      ]
    }'
  ```
</CodeGroup>

### Function Calling

Definieren Sie Funktionen, die Modelle aufrufen können, um mit externen Tools und APIs zu interagieren:

<CodeGroup>
  ```python Python theme={"system"}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.getenv("VENICE_API_KEY"),
      base_url="https://api.venice.ai/api/v1"
  )

  tools = [
      {
          "type": "function",
          "function": {
              "name": "get_weather",
              "description": "Get the current weather in a location",
              "parameters": {
                  "type": "object",
                  "properties": {
                      "location": {
                          "type": "string",
                          "description": "The city and state"
                      }
                  },
                  "required": ["location"]
              }
          }
      }
  ]

  response = client.chat.completions.create(
      model="zai-org-glm-5",
      messages=[{"role": "user", "content": "What's the weather in San Francisco?"}],
      tools=tools
  )

  print(response.choices[0].message)
  ```

  ```javascript Node.js theme={"system"}
  import OpenAI from 'openai';

  const client = new OpenAI({
      apiKey: process.env.VENICE_API_KEY,
      baseURL: 'https://api.venice.ai/api/v1'
  });

  const tools = [
      {
          type: 'function',
          function: {
              name: 'get_weather',
              description: 'Get the current weather in a location',
              parameters: {
                  type: 'object',
                  properties: {
                      location: {
                          type: 'string',
                          description: 'The city and state'
                      }
                  },
                  required: ['location']
              }
          }
      }
  ];

  const response = await client.chat.completions.create({
      model: 'zai-org-glm-5',
      messages: [{ role: 'user', content: "What's the weather in San Francisco?" }],
      tools: tools
  });

  console.log(response.choices[0].message);
  ```

  ```bash cURL theme={"system"}
  curl https://api.venice.ai/api/v1/chat/completions \
    -H "Authorization: Bearer $VENICE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "zai-org-glm-5",
      "messages": [
        {
          "role": "user",
          "content": "What'\''s the weather in San Francisco?"
        }
      ],
      "tools": [
        {
          "type": "function",
          "function": {
            "name": "get_weather",
            "description": "Get the current weather in a location",
            "parameters": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "description": "The city and state"
                }
              },
              "required": ["location"]
            }
          }
        }
      ]
    }'
  ```
</CodeGroup>

***

## Nächste Schritte

Jetzt, da Sie Ihre ersten Anfragen gestellt haben, entdecken Sie mehr von dem, was die Venice API zu bieten hat:

<CardGroup cols={2}>
  <Card title="Modelle durchsuchen" icon="database" href="/overview/models">
    Vergleichen Sie alle verfügbaren Modelle mit ihren Capabilities, Preisen und Kontextlimits
  </Card>

  <Card title="API-Referenz" icon="code" href="/api-reference/api-spec">
    Erkunden Sie die detaillierte API-Dokumentation mit allen Endpoints und Parametern
  </Card>

  <Card title="Strukturierte Antworten" icon="brackets-curly" href="/guides/features/structured-responses">
    Erfahren Sie, wie Sie JSON-Antworten mit garantierten Schemas erhalten
  </Card>

  <Card title="AI-Agents-Leitfaden" icon="robot" href="/guides/integrations/ai-agents">
    Bauen Sie mit Agent-Apps, Coding-Agenten, MCP-Tools, Skills und Krypto-Workflows
  </Card>
</CardGroup>

### Zusätzliche Ressourcen

<CardGroup cols={2}>
  <Card title="Rate Limiting" icon="gauge" href="/api-reference/rate-limiting">
    Verstehen Sie Rate-Limits und Best Practices für den Produktiveinsatz
  </Card>

  <Card title="Fehlercodes" icon="triangle-exclamation" href="/api-reference/error-codes">
    Referenz für den Umgang mit API-Fehlern und Troubleshooting
  </Card>

  <Card title="Postman-Collection" icon="bolt" href="/guides/getting-started/postman">
    Importieren Sie unsere vollständige Postman-Collection zum einfachen Testen
  </Card>

  <Card title="Datenschutz & Sicherheit" icon="shield" href="/overview/privacy">
    Erfahren Sie mehr über die datenschutzorientierte Architektur und Datenverarbeitung von Venice
  </Card>
</CardGroup>

***

## Brauchen Sie Hilfe?

* **Discord-Community**: Treten Sie unserem [Discord-Server](https://discord.gg/askvenice) für Support und Diskussionen bei
* **Dokumentation**: Durchsuchen Sie unsere [vollständige API-Referenz](/api-reference/api-spec)
* **Status-Seite**: Prüfen Sie den Dienststatus auf [veniceai-status.com](https://veniceai-status.com)
* **Twitter**: Folgen Sie [@AskVenice](https://x.com/AskVenice) für Updates

<Resources />
