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

# Démarrage

Lancez-vous avec l'API Venice en quelques minutes. Générez une clé API, effectuez votre première requête et commencez à construire.

## Démarrage rapide

<Steps>
  <Step title="Obtenir votre clé API">
    Rendez-vous dans vos [Paramètres API Venice](https://venice.ai/settings/api) et générez une nouvelle clé API.

    Pour un guide détaillé avec captures d'écran, consultez le [guide de la clé API](/guides/getting-started/generating-api-key).
  </Step>

  <Step title="Configurer votre clé API">
    Ajoutez votre clé API à votre environnement. Vous pouvez l'exporter dans votre shell :

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

    Ou l'ajouter à un fichier `.env` dans votre projet :

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

  <Step title="Installer le SDK">
    Venice est compatible OpenAI, vous pouvez donc utiliser le SDK OpenAI. Si vous préférez utiliser cURL ou des requêtes HTTP brutes, vous pouvez ignorer cette étape.

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

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

  <Step title="Envoyer votre première requête">
    <CodeGroup>
      ```python Python theme={"dark"}
      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={"dark"}
      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={"dark"}
      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>

    **Rôles de message :**

    * `system` - Instructions sur le comportement attendu du modèle
    * `user` - Vos prompts ou questions
    * `assistant` - Réponses précédentes du modèle (pour les conversations multi-tours)
    * `tool` - Résultats d'appel de fonction (lors de l'utilisation d'outils)
  </Step>

  <Step title="Changer de modèle en modifiant l'ID du modèle">
    Chaque requête inclut un ID `model`. Pour utiliser un modèle différent, modifiez la valeur de `model` dans votre requête. Choix populaires :

    * `zai-org-glm-5` - Modèle par défaut pour la plupart des cas d'usage
    * `kimi-k2-6` - Raisonnement solide pour les tâches plus complexes
    * `claude-opus-4-8` - Modèle de haute intelligence pour les tâches complexes
    * `venice-uncensored-1-2` - Le modèle non censuré de Venice

    <Card title="Voir tous les modèles" icon="database" href="/models/overview">
      Parcourez la liste complète des modèles avec leur tarification, leurs capacités et leurs limites de contexte
    </Card>
  </Step>

  <Step title="Utiliser les paramètres Venice">
    Vous pouvez choisir d'activer des fonctionnalités spécifiques à Venice comme la recherche web en utilisant `venice_parameters` :

    <CodeGroup>
      ```python Python theme={"dark"}
      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={"dark"}
      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={"dark"}
      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>

    Voir tous les [paramètres disponibles](https://docs.venice.ai/api-reference/api-spec#venice-parameters).
  </Step>

  <Step title="Activer le streaming (optionnel)">
    Diffusez les réponses en temps réel en utilisant `stream=True` :

    <CodeGroup>
      ```python Python theme={"dark"}
      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={"dark"}
      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={"dark"}
      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="Personnaliser le comportement de réponse (optionnel)">
    Contrôlez la façon dont le modèle répond avec des paramètres comme temperature, max tokens et plus :

    <CodeGroup>
      ```python Python theme={"dark"}
      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={"dark"}
      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={"dark"}
      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>

    Consultez la [doc Chat Completions](/api-reference/endpoint/chat/completions) pour plus d'informations sur tous les paramètres pris en charge.
  </Step>
</Steps>

***

## Autres capacités

### Génération d'image

Créez des images à partir de prompts texte en utilisant des modèles de diffusion :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

**Note :** La réponse renvoie les images encodées en base64 dans le tableau `images`. Décodez la chaîne base64 pour enregistrer ou afficher l'image.

**Modèles d'image populaires :**

* `qwen-image` - Génération d'image de la plus haute qualité
* `venice-sd35` - Choix par défaut, fonctionne avec toutes les fonctionnalités
* `hidream` - Génération rapide pour une utilisation en production

<Card title="Voir tous les modèles d'image" icon="image" href="/models/overview#image-models">
  Voir tous les modèles d'image disponibles avec leur tarification et leurs capacités
</Card>

Pour des options de paramètres plus avancées comme `cfg_scale`, `negative_prompt`, `style_preset`, `seed`, `variants` et plus, consultez la [référence API Images](/api-reference/endpoint/image/generate).

### Édition d'image

Modifiez des images existantes avec de l'inpainting alimenté par IA en utilisant le modèle Qwen-Image :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

**Note :** L'éditeur d'image utilise le modèle Qwen-Image et est un endpoint expérimental. Envoyez l'image d'entrée sous forme de chaîne encodée en base64, et l'API renvoie l'image éditée sous forme de données binaires.

Voir l'[API Image Edit](/api-reference/endpoint/image/edit) pour tous les paramètres.

### Agrandissement d'image

Améliorez et agrandissez des images vers des résolutions plus élevées :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

**Note :** Envoyez l'image d'entrée sous forme de chaîne encodée en base64, et l'API renvoie l'image agrandie sous forme de données binaires.

Voir l'[API Image Upscale](/api-reference/endpoint/image/upscale) pour tous les paramètres.

### Synthèse vocale (Text-to-Speech)

Convertissez du texte en audio avec plus de 50 voix multilingues :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

Le modèle `tts-kokoro` prend en charge plus de 50 voix multilingues, dont `af_sky`, `af_nova`, `am_liam`, `bf_emma`, `zf_xiaobei` et `jm_kumo`.

Voir l'[API TTS](/api-reference/endpoint/audio/speech) pour toutes les options de voix.

### Transcription (Speech-to-Text)

Transcrivez des fichiers audio en texte :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

Formats pris en charge : WAV, FLAC, MP3, M4A, AAC, MP4. Activez `timestamps=true` pour obtenir des données de chronométrage au niveau du mot.

Voir l'[API Transcriptions](/api-reference/endpoint/audio/transcriptions) pour toutes les options.

### Embeddings

Générez des embeddings vectoriels pour la recherche sémantique, le RAG et les recommandations :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

Voir l'[API Embeddings](/api-reference/endpoint/embeddings/generate) pour le traitement par lots et les options avancées.

### Vision (multimodal)

Analysez des images avec du texte en utilisant des modèles capables de vision comme `qwen3-vl-235b-a22b` :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

### Appels de fonctions

Définissez des fonctions que les modèles peuvent appeler pour interagir avec des outils et API externes :

<CodeGroup>
  ```python Python theme={"dark"}
  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={"dark"}
  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={"dark"}
  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>

***

## Étapes suivantes

Maintenant que vous avez effectué vos premières requêtes, explorez davantage ce que l'API Venice a à offrir :

<CardGroup cols={2}>
  <Card title="Parcourir les modèles" icon="database" href="/models/overview">
    Comparez tous les modèles disponibles avec leurs capacités, leur tarification et leurs limites de contexte
  </Card>

  <Card title="Référence API" icon="code" href="/api-reference/api-spec">
    Explorez la documentation API détaillée avec tous les endpoints et paramètres
  </Card>

  <Card title="Réponses structurées" icon="brackets-curly" href="/guides/features/structured-responses">
    Apprenez à obtenir des réponses JSON avec des schémas garantis
  </Card>

  <Card title="Guide Agents IA" icon="robot" href="/guides/integrations/ai-agents">
    Construisez avec des applications d'agent, des agents de codage, des outils MCP, des skills et des workflows crypto
  </Card>
</CardGroup>

### Ressources supplémentaires

<CardGroup cols={2}>
  <Card title="Limites de débit" icon="gauge" href="/api-reference/rate-limiting">
    Comprenez les limites de débit et les bonnes pratiques pour une utilisation en production
  </Card>

  <Card title="Codes d'erreur" icon="triangle-exclamation" href="/api-reference/error-codes">
    Référence pour gérer les erreurs API et résoudre les problèmes
  </Card>

  <Card title="Collection Postman" icon="bolt" href="/guides/getting-started/postman">
    Importez notre collection Postman complète pour tester facilement
  </Card>

  <Card title="Confidentialité et sécurité" icon="shield" href="/overview/privacy">
    Découvrez l'architecture privacy-first de Venice et la gestion des données
  </Card>
</CardGroup>

***

## Besoin d'aide ?

* **Communauté Discord** : Rejoignez notre [serveur Discord](https://discord.gg/askvenice) pour le support et les discussions
* **Documentation** : Parcourez notre [référence API complète](/api-reference/api-spec)
* **Page de statut** : Vérifiez l'état du service sur [veniceai-status.com](https://veniceai-status.com)
* **Twitter** : Suivez [@AskVenice](https://x.com/AskVenice) pour les mises à jour

<Resources />
