{
  "aboutHtml": "<p>Hunyuan Code est le profil orienté vers la programmation de la liste nommée Hunyuan de Tencent. Son profil de conversation indique une longueur de contexte de 4 000 jetons. Préparez la tâche autour du code pertinent pour la question immédiate.</p><h4>Définissez une demande de programmation délimitée</h4><p>Fournissez l’interface, des entrées représentatives et les sorties attendues. Demandez une implémentation ciblée et des tests pour les cas que vous désignez. Pour une correction, incluez l’erreur exacte, l’entrée qui la déclenche et le comportement attendu à la place.</p><p>Une demande d’explication peut désigner la partie du code à examiner et la question à résoudre, par exemple la gestion d’une entrée vide ou le sens d’une valeur renvoyée.</p><h4>Préservez le contexte nécessaire</h4><p>Incluez les types et les définitions auxiliaires pertinents tout en laissant les fichiers sans rapport hors de la consigne. Réservez de la place à la réponse dans le contexte indiqué. Examinez et exécutez le code renvoyé dans le projet cible; les résultats des tests dans cet environnement établissent si la modification proposée répond à la demande.</p>",
  "aboutText": "Hunyuan Code est le profil orienté vers la programmation de la liste nommée Hunyuan de Tencent. Son profil de conversation indique une longueur de contexte de 4 000 jetons. Préparez la tâche autour du code pertinent pour la question immédiate.\n\n### Définissez une demande de programmation délimitée\n\nFournissez l’interface, des entrées représentatives et les sorties attendues. Demandez une implémentation ciblée et des tests pour les cas que vous désignez. Pour une correction, incluez l’erreur exacte, l’entrée qui la déclenche et le comportement attendu à la place.\n\nUne demande d’explication peut désigner la partie du code à examiner et la question à résoudre, par exemple la gestion d’une entrée vide ou le sens d’une valeur renvoyée.\n\n### Préservez le contexte nécessaire\n\nIncluez les types et les définitions auxiliaires pertinents tout en laissant les fichiers sans rapport hors de la consigne. Réservez de la place à la réponse dans le contexte indiqué. Examinez et exécutez le code renvoyé dans le projet cible; les résultats des tests dans cet environnement établissent si la modification proposée répond à la demande.",
  "editorialOverlay": {
    "copy_fields": {
      "practical_html": "<h3>Cas pratique</h3><p>Exemple technique en anglais</p><pre><code>Implement stable list deduplication\n\nWrite a Python function unique_names(names) that removes duplicate strings while keeping their first-occurrence order. Matching is case-sensitive, and the input list must remain unchanged. Include tests for [&quot;Ada&quot;, &quot;Ben&quot;, &quot;Ada&quot;], [&quot;Ada&quot;, &quot;ada&quot;] and an empty list. Explain the time and space complexity.</code></pre><h4>Résultat attendu</h4><pre><code>A self-contained Python function, three tests and a short complexity statement.</code></pre><h4>Vérifier le résultat</h4><pre><code>Check stable order, case-sensitive matching and preservation of the input list.</code></pre>"
    },
    "copy_sha256": "f644d3328d9c6adf52eb52576e9a6b2f6a23c66d5a86da4b306a5295801051a7",
    "copy_source": {
      "locale": "fr-ca",
      "pack_sha256": "0f56d90ba41881e1134accf82e57338f246f8753ca4c0cee929aaffada5d10e7",
      "record_model_id": "hunyuan-code",
      "source_facts_sha256": "f7b1b9dfb7c3bb0d322d369eb80a723d5154c1adab3f7111f1bd620b813673d3",
      "validation_sha256": "a2ac2f28056280fc0b2ea34a501bf156d5ce155406e57e708edf30bfdf6bfdc6"
    },
    "html_sha256": "79abdc07faa23f0bc4e1005e7dcc84c7c70d8e6fb8431d2917d6f4ac1d37c94f",
    "module_sha256": "ee9dc1c50b1e6a8fb7fa062030fcb4646b9aaaeb08be513b723a5a92a7290f06",
    "raw_model_unchanged": true,
    "schema": "ailoot-native-model-editorial-v1"
  },
  "locale": "fr-ca",
  "methods": [
    {
      "html": "<div class=\"sheet-head\"><span class=\"mav\" aria-hidden=\"true\">•</span><h2 id=\"sheet-title\">Hunyuan-Code</h2><button class=\"icon-btn\" type=\"button\" data-close-sheet aria-label=\"Fermer\">×</button></div><div class=\"idline\"><span>Tencent /</span><code>hunyuan-code</code><button type=\"button\" id=\"copy-id\">Copier l’ID</button></div><nav class=\"card-jump-nav\" aria-label=\"Rubriques de la fiche modèle\"><button type=\"button\" data-card-jump=\"overview\">Pour commencer</button><button type=\"button\" data-card-jump=\"methods\">Entrées et méthodes</button><button type=\"button\" data-card-jump=\"pricing\">Tarifs</button><button type=\"button\" data-card-jump=\"examples\">Exemples</button><button type=\"button\" data-card-jump=\"results\">Résultats</button><button type=\"button\" data-card-jump=\"aliases\">Alias</button></nav><div class=\"card-method-tabs\" role=\"tablist\" aria-label=\"Méthodes API\"><button type=\"button\" role=\"tab\" tabindex=\"0\" aria-controls=\"card-method-content\" aria-selected=\"true\" id=\"card-method-tab-0\" data-card-method=\"Ultra|chat|/v1/chat/completions|hunyuan-code\">Chat</button><button type=\"button\" role=\"tab\" tabindex=\"-1\" aria-controls=\"card-method-content\" aria-selected=\"false\" id=\"card-method-tab-1\" data-card-method=\"Ultra|messages|/v1/messages|hunyuan-code\">Messages</button></div><div id=\"card-method-content\" role=\"tabpanel\" aria-labelledby=\"card-method-tab-0\"><section class=\"card-section\" data-card-section=\"overview\"><h3 tabindex=\"-1\">Pour commencer</h3><p class=\"mdesc-full\">Hunyuan Code est le profil de conversation Hunyuan de Tencent orienté vers la programmation, avec un contexte indiqué de 4 000 jetons. Fournissez un extrait de code délimité et le comportement prévu, puis indiquez si vous avez besoin d’une implémentation, d’une explication ou d’une correction.</p><dl class=\"card-io\" data-card-io><div><dt>Entrées acceptées</dt><dd>Texte</dd></div><div><dt>Résultats</dt><dd>Texte</dd></div></dl><details class=\"card-about\"><summary>À propos du modèle</summary><p class=\"note-s\" data-model-method-boundary>Cette description présente les capacités du modèle. Les entrées, sorties et options disponibles dans Ailoot pour la méthode sélectionnée figurent ci-dessous.</p><div class=\"mabout\" id=\"m-about\"><p>Hunyuan Code est le profil orienté vers la programmation de la liste nommée Hunyuan de Tencent. Son profil de conversation indique une longueur de contexte de 4 000 jetons. Préparez la tâche autour du code pertinent pour la question immédiate.</p><h4>Définissez une demande de programmation délimitée</h4><p>Fournissez l’interface, des entrées représentatives et les sorties attendues. Demandez une implémentation ciblée et des tests pour les cas que vous désignez. Pour une correction, incluez l’erreur exacte, l’entrée qui la déclenche et le comportement attendu à la place.</p><p>Une demande d’explication peut désigner la partie du code à examiner et la question à résoudre, par exemple la gestion d’une entrée vide ou le sens d’une valeur renvoyée.</p><h4>Préservez le contexte nécessaire</h4><p>Incluez les types et les définitions auxiliaires pertinents tout en laissant les fichiers sans rapport hors de la consigne. Réservez de la place à la réponse dans le contexte indiqué. Examinez et exécutez le code renvoyé dans le projet cible; les résultats des tests dans cet environnement établissent si la modification proposée répond à la demande.</p></div></details></section><section class=\"card-section\" data-card-section=\"methods\"><h3 tabindex=\"-1\">Disponible dans Ailoot · entrées et méthodes</h3><details class=\"card-method\" open><summary><b>Ailoot Ultra · OpenAI Chat</b> <code>POST /v1/chat/completions</code></summary><dl class=\"method-capabilities\"><div><dt>Entrée</dt><dd><code>text</code></dd></div><div><dt>Sortie</dt><dd><code>text</code></dd></div><div><dt>Format de sortie</dt><dd>json ou SSE</dd></div></dl><div class=\"tw\" data-card-parameters data-typed-parameters><table><thead><tr><th>Champ</th><th>Type</th><th>Exigence</th><th>Valeurs et limites</th><th>Par défaut</th></tr></thead><tbody><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">model</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>hunyuan-code</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>message[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Nombre minimal d’éléments: 1</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].role</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Exemples : system, user, assistant, tool, function</div><div>Conditions: Ces rôles sont explicitement représentés par les types de compatibilité du code source ; l’ensemble exact des rôles reste propre à chaque modèle.</div><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].content</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string|content_part[]|null</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].tool_calls</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>tool_call[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].tool_call_id</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>S’applique lorsque: role=tool ; utilisez l’ID réellement renvoyé</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].name</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].reasoning_content</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>S’applique lorsque: Réinjectez le raisonnement réellement renvoyé lorsque ce modèle l’utilise</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].reasoning_details</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>object|array</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">max_tokens</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>integer</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Minimum: 1</div><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">max_completion_tokens</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>integer</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Minimum: 1</div><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">stream</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>boolean</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"known\"><span class=\"card-cell-label\">Par défaut</span>false</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">stream_options.include_usage</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>boolean</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">temperature</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>number</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">top_p</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>number</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">stop</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string|string[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tools</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>function_tool[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tools[].type</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>function</div><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tools[].function.name</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>S’applique lorsque: Fonction fournie comme outil</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tools[].function.description</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tools[].function.parameters</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>JSON_schema</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">tool_choice</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string|object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">parallel_tool_calls</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>boolean</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">response_format</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">reasoning_effort</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">reasoning</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">service_tier</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_compatibility\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">instructions</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Champ de compatibilité</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">functions</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>function[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">function_call</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string|object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"model_dependent\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">prompt_cache_options</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div class=\"note-s\">Selon le modèle</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">modalities</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>text</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">provider</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>object</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Conditions: provider.options est refusé sur cette route textuelle Ultra</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">cache_control.ttl</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>Conditions: La valeur 1h est refusée là où le cache des prompts est configuré</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr></tbody></table></div><details class=\"card-about\" data-material-combinations><summary>Combinaisons d’éléments d’entrée</summary><p class=\"note-s\"><b>Texte</b> · Texte UTF8</p><p class=\"note-s\"><code>messages[].content</code></p></details><details class=\"note-s\" data-method-contract><summary>Paramètres et cycle de vie de la méthode</summary><div class=\"tw\" data-card-table=\"contract\"><table><thead><tr><th>Paramètre</th><th>Contrat</th></tr></thead><tbody><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>content_type</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>application/json</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>required</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>model, messages</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>material_types</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>text</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>messages</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>Tableau de messages avec une structure role/content</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>file_material</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>Document UTF-8 réel inséré comme texte littéral ; aucun ID de fichier déduit</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>optional_controls</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>stream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>control_scope</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>Propre au modèle ; les outils de fonctions de l’utilisateur diffèrent des outils hébergés</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>output_modalities</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>text</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>hosted_operations</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>false</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>multimodal_input_binding</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>null</td></tr></tbody></table></div><p>Cycle de vie : <code>synchronous_or_streamed</code></p><p class=\"note-s\">Envoyez l’ID exact du modèle avec messages.</p><p class=\"note-s\">La longueur du contexte n’est pas un plafond de sortie.</p><p class=\"note-s\">Un fichier texte peut fournir du texte littéral ; les entrées image/audio/objet fichier nécessitent une liaison exacte.</p></details></details></section><section class=\"card-section\" data-card-section=\"pricing\"><h3 tabindex=\"-1\">Tarifs</h3><div data-native-semantic-method=\"v1\" data-tariff-reference-only><p class=\"note-s\" data-rate-support-note>Les tarifs n’ajoutent pas d’options de requête. Les paramètres pris en charge figurent dans la méthode sélectionnée.</p><dl data-price-conditions><dt>Mode rapide</dt><dd>Non précisé <span class=\"note-s\">Lorsque le mode rapide est sélectionné</span></dd><dt>Mode Flex</dt><dd>Non précisé <span class=\"note-s\">Lorsque le mode flex est sélectionné</span></dd><dt>Effort de raisonnement maximal</dt><dd>Non précisé <span class=\"note-s\">Lorsque l’effort de raisonnement maximal utilise l’ajustement par défaut (default)</span></dd></dl></div><div data-declared-tariff-pricing><h4>Tarifs Ailoot</h4><h4>Prix par configuration</h4><div class=\"tw\" data-pricing-profiles><table><thead><tr><th>Configuration</th><th>Barème tarifaire</th><th>Coût</th></tr></thead><tbody><tr><th data-cell-label=\"Configuration\" scope=\"row\"><span class=\"card-cell-label\">Configuration</span>Tarifs de base des jetons</th><td data-cell-label=\"Barème tarifaire\"><span class=\"card-cell-label\">Barème tarifaire</span>Tarif de base</td><td data-cell-label=\"Coût\"><span class=\"card-cell-label\">Coût</span><div><span>Entrée · Jetons en entrée</span> <b>$0.001254</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Sortie · Jetons en sortie</span> <b>$0.002508</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Lecture du cache</span> <b>$0</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Écriture dans le cache</span> <b>$0</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Écriture dans le cache, 1 h</span> <b>—</b> <span class=\"price-unit\">/ 1K jetons</span></div></td></tr></tbody></table></div></div><p class=\"note-s\">Ailoot réserve un montant estimé avant une requête. Après le résultat, le montant final est débité selon l’utilisation mesurée. Pour le streaming, le montant final à débiter est calculé à partir du relevé final d’utilisation. <a href=\"/docs/fr-ca/billing/reserve/\">Fonctionnement de la réservation et du débit →</a></p></section><section class=\"card-section\" data-card-section=\"examples\"><h3 tabindex=\"-1\">Exemples de requêtes</h3><h4>Ailoot Ultra · OpenAI Chat</h4><div class=\"code-group\"><div class=\"cg-bar\"><div class=\"cg-tabs\" role=\"tablist\" aria-label=\"Variantes du code\"><button class=\"cg-tab\" id=\"model-code-1716-tab-0\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1716-panel-0\" aria-selected=\"true\" tabindex=\"0\">curl</button><button class=\"cg-tab\" id=\"model-code-1716-tab-1\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1716-panel-1\" aria-selected=\"false\" tabindex=\"-1\">Python SDK</button><button class=\"cg-tab\" id=\"model-code-1716-tab-2\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1716-panel-2\" aria-selected=\"false\" tabindex=\"-1\">Streaming Python</button></div><div class=\"cg-tools\"><button class=\"cg-btn cg-copy\" type=\"button\" aria-label=\"Copier le code\"><svg class=\"cp\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"><rect x=\"5.25\" y=\"5.25\" width=\"8.5\" height=\"8.5\" rx=\"1.75\"/><path d=\"M10.75 5.25V3.5a1.25 1.25 0 0 0-1.25-1.25H3.5A1.25 1.25 0 0 0 2.25 3.5v6a1.25 1.25 0 0 0 1.25 1.25h1.75\"/></svg><svg class=\"ok\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"><path d=\"m3 8.5 3.25 3.25L13 5\"/></svg></button></div></div><div class=\"cg-body\"><div class=\"cg-pane\" id=\"model-code-1716-panel-0\" role=\"tabpanel\" aria-labelledby=\"model-code-1716-tab-0\"><pre data-lang=\"bash\"><code>set -eu\n: &quot;${AILOOT_API_KEY:?Set your Ailoot API key}&quot;\npython3 - &lt;&lt;&#39;PY_REQUEST&#39;\nimport json,os\nfrom pathlib import Path\np=json.loads(&#39;{&quot;model&quot;: &quot;hunyuan-code&quot;, &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Explain the difference between an observation and a hypothesis in three sentences.&quot;}]}&#39;)\n\nPath(&quot;request.json&quot;).write_text(json.dumps(p,ensure_ascii=False))\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \\\n  -H &quot;Authorization: Bearer $AILOOT_API_KEY&quot; -H &#39;Content-Type: application/json&#39; \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - &lt;&lt;&#39;PY_RESULT&#39;\nimport json\nfrom pathlib import Path\nr=json.loads(Path(&quot;result.json&quot;).read_text())\nfor x in r.get(&quot;choices&quot;,[]):\n    if x.get(&quot;message&quot;,{}).get(&quot;content&quot;): print(x[&quot;message&quot;][&quot;content&quot;])\nPY_RESULT\n</code></pre></div><div class=\"cg-pane\" id=\"model-code-1716-panel-1\" role=\"tabpanel\" aria-labelledby=\"model-code-1716-tab-1\" hidden><pre data-lang=\"python\"><code>from openai import OpenAI\nimport os\n\nif not os.environ.get(&quot;AILOOT_API_KEY&quot;, &quot;&quot;).strip(): raise SystemExit(&quot;Set AILOOT_API_KEY before making a request&quot;)\nclient=OpenAI(base_url=&quot;https://api.ailoot.ai/v1&quot;,api_key=os.environ[&quot;AILOOT_API_KEY&quot;],max_retries=0)\nresult=client.chat.completions.create(model=&#39;hunyuan-code&#39;,messages=[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;Explain observations and hypotheses in three sentences.&quot;}])\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=&quot;result&quot;):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + &quot;.json&quot;).write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=&quot;utf-8&quot;)\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b&quot;-_&quot;, validate=True)\n        ext = &quot;png&quot; if raw.startswith(b&quot;\\x89PNG\\r\\n\\x1a\\n&quot;) else &quot;jpg&quot; if raw.startswith(b&quot;\\xff\\xd8&quot;) else &quot;webp&quot; if raw[:4] == b&quot;RIFF&quot; and raw[8:12] == b&quot;WEBP&quot; else suffix\n        file = Path(stem + &quot;-&quot; + label + &quot;.&quot; + ext)\n        file.write_bytes(raw)\n        print(&quot;Saved&quot;, file)\n    for index, block in enumerate(data.get(&quot;content&quot;) or []):\n        print(&quot;Content&quot;, index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(&quot;choices&quot;) or []:\n        print(&quot;Choice&quot;, choice.get(&quot;index&quot;), json.dumps(choice.get(&quot;message&quot;, choice.get(&quot;delta&quot;, {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(&quot;output&quot;) or []):\n        print(&quot;Output&quot;, index, json.dumps(item, ensure_ascii=False))\n        if item.get(&quot;type&quot;) == &quot;image_generation_call&quot; and item.get(&quot;result&quot;):\n            save_blob(item[&quot;result&quot;], item.get(&quot;output_format&quot;) or &quot;bin&quot;, &quot;output-&quot; + str(index))\n    for ci, candidate in enumerate(data.get(&quot;candidates&quot;) or []):\n        for pi, part in enumerate((candidate.get(&quot;content&quot;) or {}).get(&quot;parts&quot;) or []):\n            print(&quot;Candidate/part&quot;, ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(&quot;inlineData&quot;) or part.get(&quot;inline_data&quot;)\n            if blob and blob.get(&quot;data&quot;):\n                mime = blob.get(&quot;mimeType&quot;) or blob.get(&quot;mime_type&quot;)\n                suffix = {&quot;image/png&quot;:&quot;png&quot;, &quot;image/jpeg&quot;:&quot;jpg&quot;, &quot;image/webp&quot;:&quot;webp&quot;, &quot;audio/wav&quot;:&quot;wav&quot;, &quot;audio/mpeg&quot;:&quot;mp3&quot;, &quot;video/mp4&quot;:&quot;mp4&quot;}.get(mime, &quot;bin&quot;)\n                save_blob(blob[&quot;data&quot;], suffix, &quot;candidate-&quot; + str(ci) + &quot;-part-&quot; + str(pi))\n\nsave_result(result.to_dict(mode=&quot;json&quot;))\n</code></pre></div><div class=\"cg-pane\" id=\"model-code-1716-panel-2\" role=\"tabpanel\" aria-labelledby=\"model-code-1716-tab-2\" hidden><pre data-lang=\"python\"><code>from openai import OpenAI\nimport os\nfrom pathlib import Path\n\nif not os.environ.get(&quot;AILOOT_API_KEY&quot;, &quot;&quot;).strip(): raise SystemExit(&quot;Set AILOOT_API_KEY before making a request&quot;)\nclient=OpenAI(base_url=&quot;https://api.ailoot.ai/v1&quot;,api_key=os.environ[&quot;AILOOT_API_KEY&quot;],max_retries=0)\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=&quot;result&quot;):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + &quot;.json&quot;).write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=&quot;utf-8&quot;)\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b&quot;-_&quot;, validate=True)\n        ext = &quot;png&quot; if raw.startswith(b&quot;\\x89PNG\\r\\n\\x1a\\n&quot;) else &quot;jpg&quot; if raw.startswith(b&quot;\\xff\\xd8&quot;) else &quot;webp&quot; if raw[:4] == b&quot;RIFF&quot; and raw[8:12] == b&quot;WEBP&quot; else suffix\n        file = Path(stem + &quot;-&quot; + label + &quot;.&quot; + ext)\n        file.write_bytes(raw)\n        print(&quot;Saved&quot;, file)\n    for index, block in enumerate(data.get(&quot;content&quot;) or []):\n        print(&quot;Content&quot;, index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(&quot;choices&quot;) or []:\n        print(&quot;Choice&quot;, choice.get(&quot;index&quot;), json.dumps(choice.get(&quot;message&quot;, choice.get(&quot;delta&quot;, {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(&quot;output&quot;) or []):\n        print(&quot;Output&quot;, index, json.dumps(item, ensure_ascii=False))\n        if item.get(&quot;type&quot;) == &quot;image_generation_call&quot; and item.get(&quot;result&quot;):\n            save_blob(item[&quot;result&quot;], item.get(&quot;output_format&quot;) or &quot;bin&quot;, &quot;output-&quot; + str(index))\n    for ci, candidate in enumerate(data.get(&quot;candidates&quot;) or []):\n        for pi, part in enumerate((candidate.get(&quot;content&quot;) or {}).get(&quot;parts&quot;) or []):\n            print(&quot;Candidate/part&quot;, ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(&quot;inlineData&quot;) or part.get(&quot;inline_data&quot;)\n            if blob and blob.get(&quot;data&quot;):\n                mime = blob.get(&quot;mimeType&quot;) or blob.get(&quot;mime_type&quot;)\n                suffix = {&quot;image/png&quot;:&quot;png&quot;, &quot;image/jpeg&quot;:&quot;jpg&quot;, &quot;image/webp&quot;:&quot;webp&quot;, &quot;audio/wav&quot;:&quot;wav&quot;, &quot;audio/mpeg&quot;:&quot;mp3&quot;, &quot;video/mp4&quot;:&quot;mp4&quot;}.get(mime, &quot;bin&quot;)\n                save_blob(blob[&quot;data&quot;], suffix, &quot;candidate-&quot; + str(ci) + &quot;-part-&quot; + str(pi))\n\nwith client.chat.completions.stream(model=&#39;hunyuan-code&#39;,messages=[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;Explain observations and hypotheses in three sentences.&quot;}]) as stream:\n    with Path(&quot;stream-events.jsonl&quot;).open(&quot;w&quot;,encoding=&quot;utf-8&quot;) as log:\n        for event in stream:\n            payload=event.to_dict(mode=&quot;json&quot;)\n            log.write(json.dumps(payload,ensure_ascii=False)+&quot;\\n&quot;); log.flush()\n            print(json.dumps(payload,ensure_ascii=False))\n    final=stream.get_final_completion()\n    save_result(final.to_dict(mode=&quot;json&quot;),&quot;stream-result&quot;)\n</code></pre></div></div></div></section><section class=\"card-section\" data-card-section=\"results\"><h3 tabindex=\"-1\">Recevoir et enregistrer les résultats</h3><h4>Ailoot Ultra · OpenAI Chat</h4><p class=\"note-s\">json ou SSE</p><div class=\"card-result-process\" data-all-results><h5>Conserver tous les résultats terminés</h5><p class=\"note-s\">Conservez chaque réponse, fichier et partie de contenu renvoyés dans leur intégralité.</p><p class=\"note-s\">Conservez chaque choix avec son contenu, ses appels d’outils et son raisonnement. En SSE, assemblez les deltas par index de choix et d’outil, et conservez le motif final d’arrêt et les données d’utilisation.</p></div><div class=\"card-result-process\" data-unknown-recovery><h5>Si la réponse d’origine doit être vérifiée</h5><p class=\"note-s\">Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie.</p></div><details class=\"card-about\" data-output-fields><summary>Champs de la réponse</summary><div class=\"tw\" data-card-table=\"output\"><table><thead><tr><th>Champ</th><th>Type</th></tr></thead><tbody><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].index</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>integer</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].message.content</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string|null</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].message.tool_calls</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>tool_call[]</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].message.reasoning_content</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].message.reasoning_details</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>object|array</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">choices[].finish_reason</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string|null</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">usage</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>object</td></tr></tbody></table></div></details><details class=\"card-about\" data-method-errors><summary>Erreurs et étapes suivantes</summary><div class=\"tw\" data-card-table=\"errors\"><table><thead><tr><th>Réponse</th><th>Condition</th><th>Étape suivante</th></tr></thead><tbody><tr><th data-cell-label=\"Réponse\" scope=\"row\"><span class=\"card-cell-label\">Réponse</span>400 · <code>invalid_request_error</code></th><td data-cell-label=\"Condition\"><span class=\"card-cell-label\">Condition</span>Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides</td><td data-cell-label=\"Étape suivante\"><span class=\"card-cell-label\">Étape suivante</span>Corrigez les champs indiqués avant une nouvelle requête de création.</td></tr></tbody></table></div></details></section><section class=\"card-section\" data-card-section=\"aliases\"><h3 tabindex=\"-1\">Alias</h3><h4>Alias du modèle</h4><p class=\"note-s\"><span data-model-alias-route=\"Ultra\"><b>Ailoot Ultra</b> <a href=\"#m=hunyuan-code&amp;route=Ultra&amp;caller=hunyuan-code&amp;fmt=chat\"><code>hunyuan-code</code></a></span></p><h4>Alias des chemins de méthode</h4><p class=\"note-s\">Utilisez les chemins de méthode indiqués ci-dessus.</p><h4>ID d’appel associés</h4><p class=\"note-s\"><a href=\"#m=hunyuan-code&amp;route=Ultra&amp;caller=hunyuan-code&amp;fmt=chat\"><code>hunyuan-code</code></a></p></section></div>",
      "method_identity": {
        "effective_request_model_id": "hunyuan-code",
        "fmt": "chat",
        "http": "POST",
        "path": "/v1/chat/completions",
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra"
      },
      "method_key": "Ultra|chat|/v1/chat/completions|hunyuan-code",
      "ordinal": 0,
      "rawMethod": {
        "available": null,
        "cache_read": 0,
        "cache_write": 0,
        "cache_write_1h": null,
        "contract": {
          "data": {
            "all_results": "Keep every choice and its content/tool calls/reasoning. In SSE assemble deltas by choice/tool index, retain the final finish reason and usage.",
            "authentication": {
              "api_key_source": "AILOOT_API_KEY",
              "header": "Authorization: Bearer"
            },
            "errors": [
              {
                "code": null,
                "condition": "Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides",
                "http_status": 400,
                "recovery": "Corrigez les champs indiqués avant une nouvelle requête de création.",
                "type": "invalid_request_error"
              }
            ],
            "hints": [
              "Model context is not an output cap.",
              "A model-dependent field needs the exact published model profile; unspecified defaults/enums are not guessed.",
              "Tool calls propose actions; the client application returns actual observations with the returned call ID.",
              "Guarded canonical keys must occur once; duplicate or case-varied model/tools/cap fields are rejected."
            ],
            "ignored_fields": [],
            "lifecycle": {
              "create": {
                "http": "POST",
                "path": "/v1/chat/completions"
              },
              "job_read": null,
              "mode": "synchronous_or_streamed",
              "unknown": "Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie."
            },
            "material_combinations": [
              {
                "mode": "text",
                "representation": "messages[].content",
                "required_material": "Texte UTF8"
              }
            ],
            "operation_modes": [
              "conversation",
              "function_tool_continuation",
              "streaming"
            ],
            "outputs": {
              "all_results": "Conservez chaque choix avec son contenu, ses appels d’outils et son raisonnement. En SSE, assemblez les deltas par index de choix et d’outil, et conservez le motif final d’arrêt et les données d’utilisation.",
              "family": "text",
              "fields": [
                {
                  "description": null,
                  "name": "choices[].index",
                  "type": "integer"
                },
                {
                  "description": null,
                  "name": "choices[].message.content",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "choices[].message.tool_calls",
                  "type": "tool_call[]"
                },
                {
                  "description": null,
                  "name": "choices[].message.reasoning_content",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "choices[].message.reasoning_details",
                  "type": "object|array"
                },
                {
                  "description": null,
                  "name": "choices[].finish_reason",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "usage",
                  "type": "object"
                }
              ],
              "format": "json ou SSE"
            },
            "parameters": [
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "hunyuan-code"
                ],
                "enum_known": true,
                "name": "model",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "min_items": 1,
                "name": "messages",
                "required": true,
                "type": "message[]"
              },
              {
                "availability": "model_dependent",
                "conditions": "Ces rôles sont explicitement représentés par les types de compatibilité du code source ; l’ensemble exact des rôles reste propre à chaque modèle.",
                "default": null,
                "default_known": false,
                "enum": [
                  "system",
                  "user",
                  "assistant",
                  "tool",
                  "function"
                ],
                "enum_exhaustive": false,
                "enum_known": true,
                "name": "messages[].role",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].content",
                "required": false,
                "type": "string|content_part[]|null"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].tool_calls",
                "required": false,
                "type": "tool_call[]"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].tool_call_id",
                "required": false,
                "type": "string",
                "when": "role=tool ; utilisez l’ID réellement renvoyé"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].name",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].reasoning_content",
                "required": false,
                "type": "string",
                "when": "Réinjectez le raisonnement réellement renvoyé lorsque ce modèle l’utilise"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].reasoning_details",
                "required": false,
                "type": "object|array"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "minimum": 1,
                "name": "max_tokens",
                "required": false,
                "type": "integer"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "minimum": 1,
                "name": "max_completion_tokens",
                "required": false,
                "type": "integer"
              },
              {
                "availability": "source_interface",
                "default": false,
                "default_known": true,
                "enum": null,
                "enum_known": false,
                "name": "stream",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "stream_options.include_usage",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "temperature",
                "required": false,
                "type": "number"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "top_p",
                "required": false,
                "type": "number"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "stop",
                "required": false,
                "type": "string|string[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools",
                "required": false,
                "type": "function_tool[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": [
                  "function"
                ],
                "enum_known": true,
                "name": "tools[].type",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.name",
                "required": true,
                "type": "string",
                "when": "Fonction fournie comme outil"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.description",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.parameters",
                "required": false,
                "type": "JSON_schema"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tool_choice",
                "required": false,
                "type": "string|object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "parallel_tool_calls",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "response_format",
                "required": false,
                "type": "object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "reasoning_effort",
                "required": false,
                "type": "string"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "reasoning",
                "required": false,
                "type": "object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "service_tier",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_compatibility",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "instructions",
                "required": false,
                "type": "string"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "functions",
                "required": false,
                "type": "function[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "function_call",
                "required": false,
                "type": "string|object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "prompt_cache_options",
                "required": false,
                "type": "object"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "text"
                ],
                "enum_known": true,
                "name": "modalities",
                "required": false,
                "type": "string[]"
              },
              {
                "availability": "source_interface",
                "conditions": "provider.options est refusé sur cette route textuelle Ultra",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "provider",
                "required": false,
                "type": "object"
              },
              {
                "availability": "source_interface",
                "conditions": "La valeur 1h est refusée là où le cache des prompts est configuré",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "cache_control.ttl",
                "required": false,
                "type": "string"
              }
            ],
            "profile_binding": "Exact existing Ailoot model and method; interface constraints below do not assert provider qualification.",
            "unsupported": [
              "additional models/models list",
              "plugins",
              "route",
              "hosted tools; ordinary client function tools remain separate",
              "non-text output modalities",
              "provider.options overrides",
              "one-hour prompt-cache TTL"
            ]
          },
          "hints": [
            "Envoyez l’ID exact du modèle avec messages.",
            "La longueur du contexte n’est pas un plafond de sortie.",
            "Un fichier texte peut fournir du texte littéral ; les entrées image/audio/objet fichier nécessitent une liaison exacte."
          ],
          "input": {
            "content_type": "application/json",
            "control_scope": "Propre au modèle ; les outils de fonctions de l’utilisateur diffèrent des outils hébergés",
            "file_material": "Document UTF-8 réel inséré comme texte littéral ; aucun ID de fichier déduit",
            "hosted_operations": false,
            "material_types": [
              "text"
            ],
            "messages": "Tableau de messages avec une structure role/content",
            "multimodal_input_binding": null,
            "optional_controls": [
              "stream",
              "temperature",
              "top_p",
              "stop",
              "max_tokens",
              "max_completion_tokens",
              "reasoning",
              "response_format",
              "tools",
              "tool_choice"
            ],
            "output_modalities": [
              "text"
            ],
            "required": [
              "model",
              "messages"
            ]
          },
          "lifecycle": {
            "mode": "synchronous_or_streamed",
            "unknown": "preserve original request id; no generic chat job retrieval path"
          },
          "manufacturer_capability": null,
          "method": {
            "http": "POST",
            "path": "/v1/chat/completions"
          },
          "method_aliases": [],
          "operation_modes": [
            "text_chat"
          ],
          "output": {
            "content": "choices[].message.content or stream delta",
            "family": "text",
            "format": "json or supported SSE",
            "tool_calls": "retain actual returned function calls"
          }
        },
        "ctx": null,
        "declared_pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Tarifs de base des jetons",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "examples": [
          {
            "code": "set -eu\n: \"${AILOOT_API_KEY:?Set your Ailoot API key}\"\npython3 - <<'PY_REQUEST'\nimport json,os\nfrom pathlib import Path\np=json.loads('{\"model\": \"hunyuan-code\", \"messages\": [{\"role\": \"user\", \"content\": \"Explain the difference between an observation and a hypothesis in three sentences.\"}]}')\n\nPath(\"request.json\").write_text(json.dumps(p,ensure_ascii=False))\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $AILOOT_API_KEY\" -H 'Content-Type: application/json' \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - <<'PY_RESULT'\nimport json\nfrom pathlib import Path\nr=json.loads(Path(\"result.json\").read_text())\nfor x in r.get(\"choices\",[]):\n    if x.get(\"message\",{}).get(\"content\"): print(x[\"message\"][\"content\"])\nPY_RESULT\n",
            "label": "curl · retained exact creation",
            "language": "bash"
          },
          {
            "code": "from openai import OpenAI\nimport os\n\nif not os.environ.get(\"AILOOT_API_KEY\", \"\").strip(): raise SystemExit(\"Set AILOOT_API_KEY before making a request\")\nclient=OpenAI(base_url=\"https://api.ailoot.ai/v1\",api_key=os.environ[\"AILOOT_API_KEY\"],max_retries=0)\nresult=client.chat.completions.create(model='hunyuan-code',messages=[{\"role\":\"user\",\"content\":\"Explain observations and hypotheses in three sentences.\"}])\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=\"result\"):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + \".json\").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=\"utf-8\")\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b\"-_\", validate=True)\n        ext = \"png\" if raw.startswith(b\"\\x89PNG\\r\\n\\x1a\\n\") else \"jpg\" if raw.startswith(b\"\\xff\\xd8\") else \"webp\" if raw[:4] == b\"RIFF\" and raw[8:12] == b\"WEBP\" else suffix\n        file = Path(stem + \"-\" + label + \".\" + ext)\n        file.write_bytes(raw)\n        print(\"Saved\", file)\n    for index, block in enumerate(data.get(\"content\") or []):\n        print(\"Content\", index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(\"choices\") or []:\n        print(\"Choice\", choice.get(\"index\"), json.dumps(choice.get(\"message\", choice.get(\"delta\", {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(\"output\") or []):\n        print(\"Output\", index, json.dumps(item, ensure_ascii=False))\n        if item.get(\"type\") == \"image_generation_call\" and item.get(\"result\"):\n            save_blob(item[\"result\"], item.get(\"output_format\") or \"bin\", \"output-\" + str(index))\n    for ci, candidate in enumerate(data.get(\"candidates\") or []):\n        for pi, part in enumerate((candidate.get(\"content\") or {}).get(\"parts\") or []):\n            print(\"Candidate/part\", ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(\"inlineData\") or part.get(\"inline_data\")\n            if blob and blob.get(\"data\"):\n                mime = blob.get(\"mimeType\") or blob.get(\"mime_type\")\n                suffix = {\"image/png\":\"png\", \"image/jpeg\":\"jpg\", \"image/webp\":\"webp\", \"audio/wav\":\"wav\", \"audio/mpeg\":\"mp3\", \"video/mp4\":\"mp4\"}.get(mime, \"bin\")\n                save_blob(blob[\"data\"], suffix, \"candidate-\" + str(ci) + \"-part-\" + str(pi))\n\nsave_result(result.to_dict(mode=\"json\"))\n",
            "label": "Python SDK · all choices",
            "language": "python"
          },
          {
            "code": "from openai import OpenAI\nimport os\nfrom pathlib import Path\n\nif not os.environ.get(\"AILOOT_API_KEY\", \"\").strip(): raise SystemExit(\"Set AILOOT_API_KEY before making a request\")\nclient=OpenAI(base_url=\"https://api.ailoot.ai/v1\",api_key=os.environ[\"AILOOT_API_KEY\"],max_retries=0)\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=\"result\"):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + \".json\").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=\"utf-8\")\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b\"-_\", validate=True)\n        ext = \"png\" if raw.startswith(b\"\\x89PNG\\r\\n\\x1a\\n\") else \"jpg\" if raw.startswith(b\"\\xff\\xd8\") else \"webp\" if raw[:4] == b\"RIFF\" and raw[8:12] == b\"WEBP\" else suffix\n        file = Path(stem + \"-\" + label + \".\" + ext)\n        file.write_bytes(raw)\n        print(\"Saved\", file)\n    for index, block in enumerate(data.get(\"content\") or []):\n        print(\"Content\", index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(\"choices\") or []:\n        print(\"Choice\", choice.get(\"index\"), json.dumps(choice.get(\"message\", choice.get(\"delta\", {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(\"output\") or []):\n        print(\"Output\", index, json.dumps(item, ensure_ascii=False))\n        if item.get(\"type\") == \"image_generation_call\" and item.get(\"result\"):\n            save_blob(item[\"result\"], item.get(\"output_format\") or \"bin\", \"output-\" + str(index))\n    for ci, candidate in enumerate(data.get(\"candidates\") or []):\n        for pi, part in enumerate((candidate.get(\"content\") or {}).get(\"parts\") or []):\n            print(\"Candidate/part\", ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(\"inlineData\") or part.get(\"inline_data\")\n            if blob and blob.get(\"data\"):\n                mime = blob.get(\"mimeType\") or blob.get(\"mime_type\")\n                suffix = {\"image/png\":\"png\", \"image/jpeg\":\"jpg\", \"image/webp\":\"webp\", \"audio/wav\":\"wav\", \"audio/mpeg\":\"mp3\", \"video/mp4\":\"mp4\"}.get(mime, \"bin\")\n                save_blob(blob[\"data\"], suffix, \"candidate-\" + str(ci) + \"-part-\" + str(pi))\n\nwith client.chat.completions.stream(model='hunyuan-code',messages=[{\"role\":\"user\",\"content\":\"Explain observations and hypotheses in three sentences.\"}]) as stream:\n    with Path(\"stream-events.jsonl\").open(\"w\",encoding=\"utf-8\") as log:\n        for event in stream:\n            payload=event.to_dict(mode=\"json\")\n            log.write(json.dumps(payload,ensure_ascii=False)+\"\\n\"); log.flush()\n            print(json.dumps(payload,ensure_ascii=False))\n    final=stream.get_final_completion()\n    save_result(final.to_dict(mode=\"json\"),\"stream-result\")\n",
            "label": "Python SDK streaming · all events",
            "language": "python"
          }
        ],
        "family": "openai",
        "fast_multiplier": null,
        "flex_multiplier": null,
        "fmt": "chat",
        "hints": [
          "Send exact model ID with messages.",
          "Context length is not an output cap.",
          "A text file may supply literal text; image/audio/file-object inputs need exact binding."
        ],
        "http": "POST",
        "in": 1.254,
        "input": [
          "text"
        ],
        "label": "OpenAI Chat",
        "max_out": null,
        "max_reasoning_effort_multiplier": null,
        "method_aliases": [],
        "out": 2.508,
        "output": [
          "text"
        ],
        "path": "/v1/chat/completions",
        "price_conditions": [
          {
            "label": "Fast mode",
            "value": "Not specified",
            "when": "When fast mode is selected"
          },
          {
            "label": "Flex mode",
            "value": "Not specified",
            "when": "When flex mode is selected"
          },
          {
            "label": "Maximum reasoning effort",
            "value": "Not specified",
            "when": "When maximum reasoning effort uses the default adjustment"
          }
        ],
        "pricing": {
          "billing_mode": "token",
          "image_input_price": null,
          "image_output_price": null,
          "per_request_price": null
        },
        "pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Base token rates",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra",
        "status_reads": [],
        "tiers": [],
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      }
    },
    {
      "html": "<div class=\"sheet-head\"><span class=\"mav\" aria-hidden=\"true\">•</span><h2 id=\"sheet-title\">Hunyuan-Code</h2><button class=\"icon-btn\" type=\"button\" data-close-sheet aria-label=\"Fermer\">×</button></div><div class=\"idline\"><span>Tencent /</span><code>hunyuan-code</code><button type=\"button\" id=\"copy-id\">Copier l’ID</button></div><nav class=\"card-jump-nav\" aria-label=\"Rubriques de la fiche modèle\"><button type=\"button\" data-card-jump=\"overview\">Pour commencer</button><button type=\"button\" data-card-jump=\"methods\">Entrées et méthodes</button><button type=\"button\" data-card-jump=\"pricing\">Tarifs</button><button type=\"button\" data-card-jump=\"examples\">Exemples</button><button type=\"button\" data-card-jump=\"results\">Résultats</button><button type=\"button\" data-card-jump=\"aliases\">Alias</button></nav><div class=\"card-method-tabs\" role=\"tablist\" aria-label=\"Méthodes API\"><button type=\"button\" role=\"tab\" tabindex=\"-1\" aria-controls=\"card-method-content\" aria-selected=\"false\" id=\"card-method-tab-0\" data-card-method=\"Ultra|chat|/v1/chat/completions|hunyuan-code\">Chat</button><button type=\"button\" role=\"tab\" tabindex=\"0\" aria-controls=\"card-method-content\" aria-selected=\"true\" id=\"card-method-tab-1\" data-card-method=\"Ultra|messages|/v1/messages|hunyuan-code\">Messages</button></div><div id=\"card-method-content\" role=\"tabpanel\" aria-labelledby=\"card-method-tab-1\"><section class=\"card-section\" data-card-section=\"overview\"><h3 tabindex=\"-1\">Pour commencer</h3><p class=\"mdesc-full\">Hunyuan Code est le profil de conversation Hunyuan de Tencent orienté vers la programmation, avec un contexte indiqué de 4 000 jetons. Fournissez un extrait de code délimité et le comportement prévu, puis indiquez si vous avez besoin d’une implémentation, d’une explication ou d’une correction.</p><dl class=\"card-io\" data-card-io><div><dt>Entrées acceptées</dt><dd>Texte</dd></div><div><dt>Résultats</dt><dd>json · sse</dd></div></dl><details class=\"card-about\"><summary>À propos du modèle</summary><p class=\"note-s\" data-model-method-boundary>Cette description présente les capacités du modèle. Les entrées, sorties et options disponibles dans Ailoot pour la méthode sélectionnée figurent ci-dessous.</p><div class=\"mabout\" id=\"m-about\"><p>Hunyuan Code est le profil orienté vers la programmation de la liste nommée Hunyuan de Tencent. Son profil de conversation indique une longueur de contexte de 4 000 jetons. Préparez la tâche autour du code pertinent pour la question immédiate.</p><h4>Définissez une demande de programmation délimitée</h4><p>Fournissez l’interface, des entrées représentatives et les sorties attendues. Demandez une implémentation ciblée et des tests pour les cas que vous désignez. Pour une correction, incluez l’erreur exacte, l’entrée qui la déclenche et le comportement attendu à la place.</p><p>Une demande d’explication peut désigner la partie du code à examiner et la question à résoudre, par exemple la gestion d’une entrée vide ou le sens d’une valeur renvoyée.</p><h4>Préservez le contexte nécessaire</h4><p>Incluez les types et les définitions auxiliaires pertinents tout en laissant les fichiers sans rapport hors de la consigne. Réservez de la place à la réponse dans le contexte indiqué. Examinez et exécutez le code renvoyé dans le projet cible; les résultats des tests dans cet environnement établissent si la modification proposée répond à la demande.</p></div></details></section><section class=\"card-section\" data-card-section=\"methods\"><h3 tabindex=\"-1\">Disponible dans Ailoot · entrées et méthodes</h3><details class=\"card-method\" open><summary><b>Ailoot Ultra · Anthropic Messages</b> <code>POST /v1/messages</code></summary><dl class=\"method-capabilities\"><div><dt>Entrée</dt><dd><code>text</code></dd></div><div><dt>Sortie</dt><dd><code>json</code>, <code>sse</code></dd></div><div><dt>Format de sortie</dt><dd>JSON ou SSE</dd></div></dl><div class=\"tw\" data-card-parameters data-typed-parameters><table><thead><tr><th>Champ</th><th>Type</th><th>Exigence</th><th>Valeurs et limites</th><th>Par défaut</th></tr></thead><tbody><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">model</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>hunyuan-code</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>message[]</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].role</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span><div>user, assistant</div></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">messages[].content</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>string</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">max_tokens</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>integer</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Obligatoire</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"unspecified\"><span class=\"card-cell-label\">Par défaut</span>—</td></tr><tr data-parameter-availability=\"source_interface\"><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">stream</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span><code>boolean</code></td><td data-cell-label=\"Exigence\"><span class=\"card-cell-label\">Exigence</span>Facultatif</td><td data-cell-label=\"Valeurs et limites\"><span class=\"card-cell-label\">Valeurs et limites</span></td><td data-cell-label=\"Par défaut\" data-default=\"known\"><span class=\"card-cell-label\">Par défaut</span>false</td></tr></tbody></table></div><details class=\"card-about\" data-material-combinations><summary>Combinaisons d’éléments d’entrée</summary><p class=\"note-s\"><b>Texte</b> · Texte UTF-8</p><p class=\"note-s\"><code>Chaîne messages[].content</code></p></details><details class=\"note-s\" data-method-contract><summary>Paramètres et cycle de vie de la méthode</summary><div class=\"tw\" data-card-table=\"contract\"><table><thead><tr><th>Paramètre</th><th>Contrat</th></tr></thead><tbody><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>content_type</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>application/json</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>required</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>model, messages, max_tokens</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>optional_controls</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>stream</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>material_types</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>text</td></tr><tr><th data-cell-label=\"Paramètre\" scope=\"row\"><span class=\"card-cell-label\">Paramètre</span><code>text_file_material</code></th><td data-cell-label=\"Contrat\"><span class=\"card-cell-label\">Contrat</span>Lisez le document UTF-8 réel et placez son texte dans l’entrée indiquée ou dans la chaîne de contenu du message.</td></tr></tbody></table></div><p>Cycle de vie : <code>synchronous_or_streamed</code></p></details></details></section><section class=\"card-section\" data-card-section=\"pricing\"><h3 tabindex=\"-1\">Tarifs</h3><div data-native-semantic-method=\"v1\" data-tariff-reference-only><p class=\"note-s\" data-rate-support-note>Les tarifs n’ajoutent pas d’options de requête. Les paramètres pris en charge figurent dans la méthode sélectionnée.</p><dl data-price-conditions><dt>Mode rapide</dt><dd>Non précisé <span class=\"note-s\">Lorsque le mode rapide est sélectionné</span></dd><dt>Mode Flex</dt><dd>Non précisé <span class=\"note-s\">Lorsque le mode flex est sélectionné</span></dd><dt>Effort de raisonnement maximal</dt><dd>Non précisé <span class=\"note-s\">Lorsque l’effort de raisonnement maximal utilise l’ajustement par défaut (default)</span></dd></dl></div><div data-declared-tariff-pricing><h4>Tarifs Ailoot</h4><h4>Prix par configuration</h4><div class=\"tw\" data-pricing-profiles><table><thead><tr><th>Configuration</th><th>Barème tarifaire</th><th>Coût</th></tr></thead><tbody><tr><th data-cell-label=\"Configuration\" scope=\"row\"><span class=\"card-cell-label\">Configuration</span>Tarifs de base des jetons</th><td data-cell-label=\"Barème tarifaire\"><span class=\"card-cell-label\">Barème tarifaire</span>Tarif de base</td><td data-cell-label=\"Coût\"><span class=\"card-cell-label\">Coût</span><div><span>Entrée · Jetons en entrée</span> <b>$0.001254</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Sortie · Jetons en sortie</span> <b>$0.002508</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Lecture du cache</span> <b>$0</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Écriture dans le cache</span> <b>$0</b> <span class=\"price-unit\">/ 1K jetons</span></div><div><span>Entrée · Écriture dans le cache, 1 h</span> <b>—</b> <span class=\"price-unit\">/ 1K jetons</span></div></td></tr></tbody></table></div></div><p class=\"note-s\">Ailoot réserve un montant estimé avant une requête. Après le résultat, le montant final est débité selon l’utilisation mesurée. Pour le streaming, le montant final à débiter est calculé à partir du relevé final d’utilisation. <a href=\"/docs/fr-ca/billing/reserve/\">Fonctionnement de la réservation et du débit →</a></p></section><section class=\"card-section\" data-card-section=\"examples\"><h3 tabindex=\"-1\">Exemples de requêtes</h3><h4>Ailoot Ultra · Anthropic Messages</h4><div class=\"code-group\"><div class=\"cg-bar\"><div class=\"cg-tabs\" role=\"tablist\" aria-label=\"Variantes du code\"><button class=\"cg-tab\" id=\"model-code-1717-tab-0\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1717-panel-0\" aria-selected=\"true\" tabindex=\"0\">Corps JSON minimal complet</button><button class=\"cg-tab\" id=\"model-code-1717-tab-1\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1717-panel-1\" aria-selected=\"false\" tabindex=\"-1\">curl · utilisez votre document UTF-8</button><button class=\"cg-tab\" id=\"model-code-1717-tab-2\" role=\"tab\" type=\"button\" aria-controls=\"model-code-1717-panel-2\" aria-selected=\"false\" tabindex=\"-1\">Python · enregistrez le résultat complet</button></div><div class=\"cg-tools\"><button class=\"cg-btn cg-copy\" type=\"button\" aria-label=\"Copier le code\"><svg class=\"cp\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"><rect x=\"5.25\" y=\"5.25\" width=\"8.5\" height=\"8.5\" rx=\"1.75\"/><path d=\"M10.75 5.25V3.5a1.25 1.25 0 0 0-1.25-1.25H3.5A1.25 1.25 0 0 0 2.25 3.5v6a1.25 1.25 0 0 0 1.25 1.25h1.75\"/></svg><svg class=\"ok\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"><path d=\"m3 8.5 3.25 3.25L13 5\"/></svg></button></div></div><div class=\"cg-body\"><div class=\"cg-pane\" id=\"model-code-1717-panel-0\" role=\"tabpanel\" aria-labelledby=\"model-code-1717-tab-0\"><pre data-lang=\"json\"><code>{\n  &quot;model&quot;: &quot;hunyuan-code&quot;,\n  &quot;max_tokens&quot;: 128,\n  &quot;messages&quot;: [\n    {\n      &quot;role&quot;: &quot;user&quot;,\n      &quot;content&quot;: &quot;Summarize the incident report.&quot;\n    }\n  ],\n  &quot;stream&quot;: false\n}</code></pre></div><div class=\"cg-pane\" id=\"model-code-1717-panel-1\" role=\"tabpanel\" aria-labelledby=\"model-code-1717-tab-1\" hidden><pre data-lang=\"bash\"><code>set -eu\n: &quot;${AILOOT_API_KEY:?Set your Ailoot API key}&quot;\n: &quot;${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}&quot;\nexport AILOOT_TEXT_FILE\npython3 - &lt;&lt;&#39;PY_REQUEST&#39;\nimport json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ[&#39;AILOOT_TEXT_FILE&#39;])\nif not source_file.is_file():\n    raise SystemExit(&#39;Set AILOOT_TEXT_FILE to your actual UTF-8 document&#39;)\ntext = source_file.read_text(encoding=&#39;utf-8&#39;)\nif not text.strip():\n    raise SystemExit(&#39;Choose a document containing text&#39;)\npayload = {&#39;model&#39;: &#39;hunyuan-code&#39;, &#39;max_tokens&#39;: 128, &#39;messages&#39;: [{&#39;role&#39;: &#39;user&#39;, &#39;content&#39;: &#39;Summarize the incident report.&#39;}]}\npayload[&#39;messages&#39;][0][&#39;content&#39;] = &#39;Summarize this material and quote supporting source passages.\\n\\n&#39; + text\nPath(&#39;request.json&#39;).write_text(json.dumps(payload, ensure_ascii=False), encoding=&#39;utf-8&#39;)\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \\\n  -H &quot;x-api-key: $AILOOT_API_KEY&quot; -H &#39;anthropic-version: 2023-06-01&#39; -H &#39;Content-Type: application/json&#39; \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - &lt;&lt;&#39;PY_RESULT&#39;\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path(&#39;result.json&#39;).read_text(encoding=&#39;utf-8&#39;))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\nPY_RESULT\n</code></pre></div><div class=\"cg-pane\" id=\"model-code-1717-panel-2\" role=\"tabpanel\" aria-labelledby=\"model-code-1717-tab-2\" hidden><pre data-lang=\"python\"><code>import json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ[&#39;AILOOT_TEXT_FILE&#39;])\nif not source_file.is_file():\n    raise SystemExit(&#39;Set AILOOT_TEXT_FILE to your actual UTF-8 document&#39;)\ntext = source_file.read_text(encoding=&#39;utf-8&#39;)\nif not text.strip():\n    raise SystemExit(&#39;Choose a document containing text&#39;)\npayload = {&#39;model&#39;: &#39;hunyuan-code&#39;, &#39;max_tokens&#39;: 128, &#39;messages&#39;: [{&#39;role&#39;: &#39;user&#39;, &#39;content&#39;: &#39;Summarize the incident report.&#39;}]}\npayload[&#39;messages&#39;][0][&#39;content&#39;] = &#39;Summarize this material and quote supporting source passages.\\n\\n&#39; + text\nfrom urllib.request import Request, urlopen\nfrom urllib.error import HTTPError\n\napi_key = os.environ[&#39;AILOOT_API_KEY&#39;]\nif not api_key.strip():\n    raise SystemExit(&#39;Set AILOOT_API_KEY before making a request&#39;)\nheaders = {&#39;x-api-key&#39;: &#39;PLACEHOLDER_KEY&#39;, &#39;anthropic-version&#39;: &#39;2023-06-01&#39;, &#39;Content-Type&#39;: &#39;application/json&#39;}\nheaders[&#39;x-api-key&#39;] = api_key\nrequest = Request(&#39;https://api.ailoot.ai/v1/messages&#39;, data=json.dumps(payload, ensure_ascii=False).encode(&#39;utf-8&#39;), headers=headers, method=&#39;POST&#39;)\ntry:\n    with urlopen(request, timeout=120) as response:\n        raw = response.read()\n        Path(&#39;response-headers.txt&#39;).write_text(str(response.headers), encoding=&#39;utf-8&#39;)\nexcept HTTPError as error:\n    Path(&#39;result.json&#39;).write_bytes(error.read())\n    Path(&#39;response-headers.txt&#39;).write_text(str(error.headers), encoding=&#39;utf-8&#39;)\n    raise\nPath(&#39;result.json&#39;).write_bytes(raw)\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path(&#39;result.json&#39;).read_text(encoding=&#39;utf-8&#39;))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\n</code></pre></div></div></div></section><section class=\"card-section\" data-card-section=\"results\"><h3 tabindex=\"-1\">Recevoir et enregistrer les résultats</h3><h4>Ailoot Ultra · Anthropic Messages</h4><p class=\"note-s\">JSON ou SSE</p><div class=\"card-result-process\" data-all-results><h5>Conserver tous les résultats terminés</h5><p class=\"note-s\">Conservez chaque réponse, fichier et partie de contenu renvoyés dans leur intégralité.</p><p class=\"note-s\">Conservez tous les blocs de contenu, les signatures de raisonnement et les ID réels d’utilisation d’outils. Assemblez tous les deltas de blocs SSE ; un premier bloc de texte ne constitue pas la sortie complète.</p></div><div class=\"card-result-process\" data-unknown-recovery><h5>Si la réponse d’origine doit être vérifiée</h5><p class=\"note-s\">Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie.</p></div><details class=\"card-about\" data-output-fields><summary>Champs de la réponse</summary><div class=\"tw\" data-card-table=\"output\"><table><thead><tr><th>Champ</th><th>Type</th></tr></thead><tbody><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">id</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">model</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">content[]</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>text|thinking|tool_use|other content block</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">stop_reason</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>string|null</td></tr><tr><th data-cell-label=\"Champ\" scope=\"row\"><span class=\"card-cell-label\">Champ</span><code class=\"card-field-name\">usage</code></th><td data-cell-label=\"Type\" data-field-type><span class=\"card-cell-label\">Type</span>object</td></tr></tbody></table></div></details><details class=\"card-about\" data-method-errors><summary>Erreurs et étapes suivantes</summary><div class=\"tw\" data-card-table=\"errors\"><table><thead><tr><th>Réponse</th><th>Condition</th><th>Étape suivante</th></tr></thead><tbody><tr><th data-cell-label=\"Réponse\" scope=\"row\"><span class=\"card-cell-label\">Réponse</span>400 · <code>invalid_request_error</code></th><td data-cell-label=\"Condition\"><span class=\"card-cell-label\">Condition</span>Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides</td><td data-cell-label=\"Étape suivante\"><span class=\"card-cell-label\">Étape suivante</span>Corrigez les champs indiqués avant une nouvelle requête de création.</td></tr></tbody></table></div></details></section><section class=\"card-section\" data-card-section=\"aliases\"><h3 tabindex=\"-1\">Alias</h3><h4>Alias du modèle</h4><p class=\"note-s\"><span data-model-alias-route=\"Ultra\"><b>Ailoot Ultra</b> <a href=\"#m=hunyuan-code&amp;route=Ultra&amp;caller=hunyuan-code&amp;fmt=messages\"><code>hunyuan-code</code></a></span></p><h4>Alias des chemins de méthode</h4><p class=\"note-s\">Utilisez les chemins de méthode indiqués ci-dessus.</p><h4>ID d’appel associés</h4><p class=\"note-s\"><a href=\"#m=hunyuan-code&amp;route=Ultra&amp;caller=hunyuan-code&amp;fmt=messages\"><code>hunyuan-code</code></a></p></section></div>",
      "method_identity": {
        "effective_request_model_id": "hunyuan-code",
        "fmt": "messages",
        "http": "POST",
        "path": "/v1/messages",
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra"
      },
      "method_key": "Ultra|messages|/v1/messages|hunyuan-code",
      "ordinal": 1,
      "rawMethod": {
        "available": null,
        "cache_read": 0,
        "cache_write": 0,
        "cache_write_1h": null,
        "contract": {
          "data": {
            "authentication": {
              "api_key_source": "AILOOT_API_KEY",
              "headers": [
                "Authorization: Bearer",
                "x-api-key",
                "anthropic-version"
              ],
              "version_example": "2023-06-01"
            },
            "errors": [
              {
                "code": null,
                "condition": "Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides",
                "http_status": 400,
                "recovery": "Corrigez les champs indiqués avant une nouvelle requête de création.",
                "type": "invalid_request_error"
              }
            ],
            "example_body": {
              "max_tokens": 128,
              "messages": [
                {
                  "content": "Summarize the incident report.",
                  "role": "user"
                }
              ],
              "model": "hunyuan-code",
              "stream": false
            },
            "lifecycle": {
              "create": {
                "http": "POST",
                "path": "/v1/messages"
              },
              "job_read": null,
              "mode": "synchronous_or_streamed",
              "unknown": "Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie."
            },
            "material_combinations": [
              {
                "mode": "text",
                "representation": "Chaîne messages[].content",
                "required_material": "Texte UTF-8"
              }
            ],
            "operation_modes": [
              "synchronous_json",
              "streamed_SSE"
            ],
            "outputs": {
              "all_results": "Conservez tous les blocs de contenu, les signatures de raisonnement et les ID réels d’utilisation d’outils. Assemblez tous les deltas de blocs SSE ; un premier bloc de texte ne constitue pas la sortie complète.",
              "family": "protocol",
              "fields": [
                {
                  "description": null,
                  "name": "id",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "model",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "content[]",
                  "type": "text|thinking|tool_use|other content block"
                },
                {
                  "description": null,
                  "name": "stop_reason",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "usage",
                  "type": "object"
                }
              ],
              "format": "JSON ou SSE"
            },
            "parameters": [
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "hunyuan-code"
                ],
                "enum_known": true,
                "name": "model",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages",
                "required": true,
                "type": "message[]"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "user",
                  "assistant"
                ],
                "enum_known": true,
                "name": "messages[].role",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].content",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "max_tokens",
                "required": true,
                "type": "integer"
              },
              {
                "availability": "source_interface",
                "default": false,
                "default_known": true,
                "enum": null,
                "enum_known": false,
                "name": "stream",
                "required": false,
                "type": "boolean"
              }
            ],
            "profile_binding": "Documented current stock Messages bridge; optional model capabilities are separate from this minimal text request.",
            "request_schema": {
              "additionalProperties": false,
              "properties": {
                "max_tokens": {
                  "minimum": 1,
                  "type": "integer"
                },
                "messages": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "content": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "items": {
                              "oneOf": [
                                {
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "const": "text"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "text"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "properties": {
                                    "source": {
                                      "oneOf": [
                                        {
                                          "properties": {
                                            "type": {
                                              "const": "url"
                                            },
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "url"
                                          ],
                                          "type": "object"
                                        },
                                        {
                                          "properties": {
                                            "data": {
                                              "type": "string"
                                            },
                                            "media_type": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "const": "base64"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "media_type",
                                            "data"
                                          ],
                                          "type": "object"
                                        }
                                      ]
                                    },
                                    "type": {
                                      "const": "image"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "source"
                                  ],
                                  "type": "object"
                                }
                              ]
                            },
                            "type": "array"
                          }
                        ]
                      },
                      "role": {
                        "enum": [
                          "user",
                          "assistant"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "role",
                      "content"
                    ],
                    "type": "object"
                  },
                  "minItems": 1,
                  "type": "array"
                },
                "model": {
                  "enum": [
                    "hunyuan-code"
                  ],
                  "type": "string"
                },
                "stream": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "model",
                "messages",
                "max_tokens"
              ],
              "type": "object"
            },
            "schema_template": {
              "max_tokens": 128,
              "messages": [
                {
                  "content": "Summarize the incident report.",
                  "role": "user"
                }
              ],
              "model": "hunyuan-code",
              "stream": false
            },
            "unsupported": [
              "No query API key.",
              "Hosted/server-side tools and model-specific optional controls are not part of this minimal family example."
            ]
          },
          "input": {
            "content_type": "application/json",
            "material_types": [
              "text"
            ],
            "optional_controls": [
              "stream"
            ],
            "required": [
              "model",
              "messages",
              "max_tokens"
            ],
            "text_file_material": "Lisez le document UTF-8 réel et placez son texte dans l’entrée indiquée ou dans la chaîne de contenu du message."
          },
          "lifecycle": {
            "create": {
              "http": "POST",
              "path": "/v1/messages"
            },
            "job_read": null,
            "mode": "synchronous_or_streamed",
            "unknown": "Keep request/response IDs and headers. No generic text job retrieval URL is supplied."
          },
          "manufacturer_capability": null,
          "method": {
            "http": "POST",
            "path": "/v1/messages"
          },
          "output": {
            "all_results": "Keep all content blocks, thinking signatures and actual tool-use IDs. Assemble all SSE block deltas; a first text block is not the complete output.",
            "family": "protocol",
            "format": "JSON or SSE"
          }
        },
        "ctx": null,
        "declared_pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Tarifs de base des jetons",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "examples": [
          {
            "code": "{\n  \"model\": \"hunyuan-code\",\n  \"max_tokens\": 128,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the incident report.\"\n    }\n  ],\n  \"stream\": false\n}",
            "label": "Complete minimal JSON body",
            "language": "json"
          },
          {
            "code": "set -eu\n: \"${AILOOT_API_KEY:?Set your Ailoot API key}\"\n: \"${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}\"\nexport AILOOT_TEXT_FILE\npython3 - <<'PY_REQUEST'\nimport json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ['AILOOT_TEXT_FILE'])\nif not source_file.is_file():\n    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')\ntext = source_file.read_text(encoding='utf-8')\nif not text.strip():\n    raise SystemExit('Choose a document containing text')\npayload = {'model': 'hunyuan-code', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}\npayload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\\n\\n' + text\nPath('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \\\n  -H \"x-api-key: $AILOOT_API_KEY\" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - <<'PY_RESULT'\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path('result.json').read_text(encoding='utf-8'))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\nPY_RESULT\n",
            "label": "curl · use your UTF-8 document",
            "language": "bash"
          },
          {
            "code": "import json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ['AILOOT_TEXT_FILE'])\nif not source_file.is_file():\n    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')\ntext = source_file.read_text(encoding='utf-8')\nif not text.strip():\n    raise SystemExit('Choose a document containing text')\npayload = {'model': 'hunyuan-code', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}\npayload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\\n\\n' + text\nfrom urllib.request import Request, urlopen\nfrom urllib.error import HTTPError\n\napi_key = os.environ['AILOOT_API_KEY']\nif not api_key.strip():\n    raise SystemExit('Set AILOOT_API_KEY before making a request')\nheaders = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}\nheaders['x-api-key'] = api_key\nrequest = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')\ntry:\n    with urlopen(request, timeout=120) as response:\n        raw = response.read()\n        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')\nexcept HTTPError as error:\n    Path('result.json').write_bytes(error.read())\n    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')\n    raise\nPath('result.json').write_bytes(raw)\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path('result.json').read_text(encoding='utf-8'))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\n",
            "label": "Python · save the complete result",
            "language": "python"
          }
        ],
        "family": "anthropic",
        "fast_multiplier": null,
        "flex_multiplier": null,
        "fmt": "messages",
        "http": "POST",
        "in": 1.254,
        "input": [
          "text"
        ],
        "label": "Anthropic Messages",
        "max_out": null,
        "max_reasoning_effort_multiplier": null,
        "method_aliases": [],
        "out": 2.508,
        "output": [
          "json",
          "sse"
        ],
        "path": "/v1/messages",
        "price_conditions": [
          {
            "label": "Fast mode",
            "value": "Not specified",
            "when": "When fast mode is selected"
          },
          {
            "label": "Flex mode",
            "value": "Not specified",
            "when": "When flex mode is selected"
          },
          {
            "label": "Maximum reasoning effort",
            "value": "Not specified",
            "when": "When maximum reasoning effort uses the default adjustment"
          }
        ],
        "pricing": {
          "billing_mode": "token",
          "image_input_price": null,
          "image_output_price": null,
          "per_request_price": null
        },
        "pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Base token rates",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra",
        "status_reads": [],
        "tiers": [],
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      }
    }
  ],
  "model_id": "hunyuan-code",
  "nativeProvenance": {
    "input_facts_canonical_sha256": "f37bc71aac193275c8889a744879d39ef31d1a4cbd2ecda5751925e4cbaedfd1",
    "input_html_sha256": "e885bccc572b7350fd6fda6f39955d36e446a063bcb8ba8c0f92887802843f80",
    "private_audit_sha256": "d4f503c517787ff1f91c32c700a98ea3b0fe38da862a48d094e9e7b61da1681a",
    "role": "historical-normalized-input-audit-hashes",
    "schema": "ailoot-native-model-provenance-v2"
  },
  "page": {
    "canonical": "https://ailoot.ai/models/fr-ca/hunyuan-code/",
    "description": "Hunyuan Code est le profil de conversation Hunyuan de Tencent orienté vers la programmation, avec un contexte indiqué de 4 000 jetons. Fournissez un extrait de code délimité et le comportement prévu, puis indiquez si vous avez besoin d’une implémentation, d’une explication ou d’une correction.",
    "locale": "fr-ca",
    "md_url": "https://ailoot.ai/models/fr-ca/hunyuan-code/index.md",
    "title": "Hunyuan-Code — Ailoot",
    "url": "https://ailoot.ai/models/fr-ca/hunyuan-code/"
  },
  "practicalHtml": "<h3>Cas pratique</h3><p>Exemple technique en anglais</p><pre><code>Implement stable list deduplication\n\nWrite a Python function unique_names(names) that removes duplicate strings while keeping their first-occurrence order. Matching is case-sensitive, and the input list must remain unchanged. Include tests for [&quot;Ada&quot;, &quot;Ben&quot;, &quot;Ada&quot;], [&quot;Ada&quot;, &quot;ada&quot;] and an empty list. Explain the time and space complexity.</code></pre><h4>Résultat attendu</h4><pre><code>A self-contained Python function, three tests and a short complexity statement.</code></pre><h4>Vérifier le résultat</h4><pre><code>Check stable order, case-sensitive matching and preservation of the input list.</code></pre>",
  "practicalText": "Cas pratique Exemple technique en anglais Implement stable list deduplication Write a Python function unique_names(names) that removes duplicate strings while keeping their first-occurrence order. Matching is case-sensitive, and the input list must remain unchanged. Include tests for [\"Ada\", \"Ben\", \"Ada\"], [\"Ada\", \"ada\"] and an empty list. Explain the time and space complexity. Résultat attendu A self-contained Python function, three tests and a short complexity statement. Vérifier le résultat Check stable order, case-sensitive matching and preservation of the input list.",
  "rawModel": {
    "about": "Hunyuan Code est le profil orienté vers la programmation de la liste nommée Hunyuan de Tencent. Son profil de conversation indique une longueur de contexte de 4 000 jetons. Préparez la tâche autour du code pertinent pour la question immédiate.\n\n### Définissez une demande de programmation délimitée\n\nFournissez l’interface, des entrées représentatives et les sorties attendues. Demandez une implémentation ciblée et des tests pour les cas que vous désignez. Pour une correction, incluez l’erreur exacte, l’entrée qui la déclenche et le comportement attendu à la place.\n\nUne demande d’explication peut désigner la partie du code à examiner et la question à résoudre, par exemple la gestion d’une entrée vide ou le sens d’une valeur renvoyée.\n\n### Préservez le contexte nécessaire\n\nIncluez les types et les définitions auxiliaires pertinents tout en laissant les fichiers sans rapport hors de la consigne. Réservez de la place à la réponse dans le contexte indiqué. Examinez et exécutez le code renvoyé dans le projet cible; les résultats des tests dans cet environnement établissent si la modification proposée répond à la demande.",
    "alias_of": null,
    "aliases": [],
    "author": "Tencent",
    "available": null,
    "canonical_model": "hunyuan-code",
    "capabilities": {
      "context_length": 4000,
      "manufacturer_input": [],
      "manufacturer_output": []
    },
    "card_routes": [
      {
        "label": "Ultra",
        "rates": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          }
        ],
        "summary": "La tarification complète de la configuration figure dans les détails."
      }
    ],
    "ctx": null,
    "entity_type": "model",
    "formats": [
      "chat",
      "messages"
    ],
    "id": "hunyuan-code",
    "input": [
      "text"
    ],
    "kind": "text",
    "max_out": null,
    "methods": [
      {
        "available": null,
        "cache_read": 0,
        "cache_write": 0,
        "cache_write_1h": null,
        "contract": {
          "data": {
            "all_results": "Keep every choice and its content/tool calls/reasoning. In SSE assemble deltas by choice/tool index, retain the final finish reason and usage.",
            "authentication": {
              "api_key_source": "AILOOT_API_KEY",
              "header": "Authorization: Bearer"
            },
            "errors": [
              {
                "code": null,
                "condition": "Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides",
                "http_status": 400,
                "recovery": "Corrigez les champs indiqués avant une nouvelle requête de création.",
                "type": "invalid_request_error"
              }
            ],
            "hints": [
              "Model context is not an output cap.",
              "A model-dependent field needs the exact published model profile; unspecified defaults/enums are not guessed.",
              "Tool calls propose actions; the client application returns actual observations with the returned call ID.",
              "Guarded canonical keys must occur once; duplicate or case-varied model/tools/cap fields are rejected."
            ],
            "ignored_fields": [],
            "lifecycle": {
              "create": {
                "http": "POST",
                "path": "/v1/chat/completions"
              },
              "job_read": null,
              "mode": "synchronous_or_streamed",
              "unknown": "Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie."
            },
            "material_combinations": [
              {
                "mode": "text",
                "representation": "messages[].content",
                "required_material": "Texte UTF8"
              }
            ],
            "operation_modes": [
              "conversation",
              "function_tool_continuation",
              "streaming"
            ],
            "outputs": {
              "all_results": "Conservez chaque choix avec son contenu, ses appels d’outils et son raisonnement. En SSE, assemblez les deltas par index de choix et d’outil, et conservez le motif final d’arrêt et les données d’utilisation.",
              "family": "text",
              "fields": [
                {
                  "description": null,
                  "name": "choices[].index",
                  "type": "integer"
                },
                {
                  "description": null,
                  "name": "choices[].message.content",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "choices[].message.tool_calls",
                  "type": "tool_call[]"
                },
                {
                  "description": null,
                  "name": "choices[].message.reasoning_content",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "choices[].message.reasoning_details",
                  "type": "object|array"
                },
                {
                  "description": null,
                  "name": "choices[].finish_reason",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "usage",
                  "type": "object"
                }
              ],
              "format": "json ou SSE"
            },
            "parameters": [
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "hunyuan-code"
                ],
                "enum_known": true,
                "name": "model",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "min_items": 1,
                "name": "messages",
                "required": true,
                "type": "message[]"
              },
              {
                "availability": "model_dependent",
                "conditions": "Ces rôles sont explicitement représentés par les types de compatibilité du code source ; l’ensemble exact des rôles reste propre à chaque modèle.",
                "default": null,
                "default_known": false,
                "enum": [
                  "system",
                  "user",
                  "assistant",
                  "tool",
                  "function"
                ],
                "enum_exhaustive": false,
                "enum_known": true,
                "name": "messages[].role",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].content",
                "required": false,
                "type": "string|content_part[]|null"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].tool_calls",
                "required": false,
                "type": "tool_call[]"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].tool_call_id",
                "required": false,
                "type": "string",
                "when": "role=tool ; utilisez l’ID réellement renvoyé"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].name",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].reasoning_content",
                "required": false,
                "type": "string",
                "when": "Réinjectez le raisonnement réellement renvoyé lorsque ce modèle l’utilise"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].reasoning_details",
                "required": false,
                "type": "object|array"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "minimum": 1,
                "name": "max_tokens",
                "required": false,
                "type": "integer"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "minimum": 1,
                "name": "max_completion_tokens",
                "required": false,
                "type": "integer"
              },
              {
                "availability": "source_interface",
                "default": false,
                "default_known": true,
                "enum": null,
                "enum_known": false,
                "name": "stream",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "stream_options.include_usage",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "temperature",
                "required": false,
                "type": "number"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "top_p",
                "required": false,
                "type": "number"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "stop",
                "required": false,
                "type": "string|string[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools",
                "required": false,
                "type": "function_tool[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": [
                  "function"
                ],
                "enum_known": true,
                "name": "tools[].type",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.name",
                "required": true,
                "type": "string",
                "when": "Fonction fournie comme outil"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.description",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tools[].function.parameters",
                "required": false,
                "type": "JSON_schema"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "tool_choice",
                "required": false,
                "type": "string|object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "parallel_tool_calls",
                "required": false,
                "type": "boolean"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "response_format",
                "required": false,
                "type": "object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "reasoning_effort",
                "required": false,
                "type": "string"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "reasoning",
                "required": false,
                "type": "object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "service_tier",
                "required": false,
                "type": "string"
              },
              {
                "availability": "source_compatibility",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "instructions",
                "required": false,
                "type": "string"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "functions",
                "required": false,
                "type": "function[]"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "function_call",
                "required": false,
                "type": "string|object"
              },
              {
                "availability": "model_dependent",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "prompt_cache_options",
                "required": false,
                "type": "object"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "text"
                ],
                "enum_known": true,
                "name": "modalities",
                "required": false,
                "type": "string[]"
              },
              {
                "availability": "source_interface",
                "conditions": "provider.options est refusé sur cette route textuelle Ultra",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "provider",
                "required": false,
                "type": "object"
              },
              {
                "availability": "source_interface",
                "conditions": "La valeur 1h est refusée là où le cache des prompts est configuré",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "cache_control.ttl",
                "required": false,
                "type": "string"
              }
            ],
            "profile_binding": "Exact existing Ailoot model and method; interface constraints below do not assert provider qualification.",
            "unsupported": [
              "additional models/models list",
              "plugins",
              "route",
              "hosted tools; ordinary client function tools remain separate",
              "non-text output modalities",
              "provider.options overrides",
              "one-hour prompt-cache TTL"
            ]
          },
          "hints": [
            "Envoyez l’ID exact du modèle avec messages.",
            "La longueur du contexte n’est pas un plafond de sortie.",
            "Un fichier texte peut fournir du texte littéral ; les entrées image/audio/objet fichier nécessitent une liaison exacte."
          ],
          "input": {
            "content_type": "application/json",
            "control_scope": "Propre au modèle ; les outils de fonctions de l’utilisateur diffèrent des outils hébergés",
            "file_material": "Document UTF-8 réel inséré comme texte littéral ; aucun ID de fichier déduit",
            "hosted_operations": false,
            "material_types": [
              "text"
            ],
            "messages": "Tableau de messages avec une structure role/content",
            "multimodal_input_binding": null,
            "optional_controls": [
              "stream",
              "temperature",
              "top_p",
              "stop",
              "max_tokens",
              "max_completion_tokens",
              "reasoning",
              "response_format",
              "tools",
              "tool_choice"
            ],
            "output_modalities": [
              "text"
            ],
            "required": [
              "model",
              "messages"
            ]
          },
          "lifecycle": {
            "mode": "synchronous_or_streamed",
            "unknown": "preserve original request id; no generic chat job retrieval path"
          },
          "manufacturer_capability": null,
          "method": {
            "http": "POST",
            "path": "/v1/chat/completions"
          },
          "method_aliases": [],
          "operation_modes": [
            "text_chat"
          ],
          "output": {
            "content": "choices[].message.content or stream delta",
            "family": "text",
            "format": "json or supported SSE",
            "tool_calls": "retain actual returned function calls"
          }
        },
        "ctx": null,
        "declared_pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Tarifs de base des jetons",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "examples": [
          {
            "code": "set -eu\n: \"${AILOOT_API_KEY:?Set your Ailoot API key}\"\npython3 - <<'PY_REQUEST'\nimport json,os\nfrom pathlib import Path\np=json.loads('{\"model\": \"hunyuan-code\", \"messages\": [{\"role\": \"user\", \"content\": \"Explain the difference between an observation and a hypothesis in three sentences.\"}]}')\n\nPath(\"request.json\").write_text(json.dumps(p,ensure_ascii=False))\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \\\n  -H \"Authorization: Bearer $AILOOT_API_KEY\" -H 'Content-Type: application/json' \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - <<'PY_RESULT'\nimport json\nfrom pathlib import Path\nr=json.loads(Path(\"result.json\").read_text())\nfor x in r.get(\"choices\",[]):\n    if x.get(\"message\",{}).get(\"content\"): print(x[\"message\"][\"content\"])\nPY_RESULT\n",
            "label": "curl · retained exact creation",
            "language": "bash"
          },
          {
            "code": "from openai import OpenAI\nimport os\n\nif not os.environ.get(\"AILOOT_API_KEY\", \"\").strip(): raise SystemExit(\"Set AILOOT_API_KEY before making a request\")\nclient=OpenAI(base_url=\"https://api.ailoot.ai/v1\",api_key=os.environ[\"AILOOT_API_KEY\"],max_retries=0)\nresult=client.chat.completions.create(model='hunyuan-code',messages=[{\"role\":\"user\",\"content\":\"Explain observations and hypotheses in three sentences.\"}])\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=\"result\"):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + \".json\").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=\"utf-8\")\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b\"-_\", validate=True)\n        ext = \"png\" if raw.startswith(b\"\\x89PNG\\r\\n\\x1a\\n\") else \"jpg\" if raw.startswith(b\"\\xff\\xd8\") else \"webp\" if raw[:4] == b\"RIFF\" and raw[8:12] == b\"WEBP\" else suffix\n        file = Path(stem + \"-\" + label + \".\" + ext)\n        file.write_bytes(raw)\n        print(\"Saved\", file)\n    for index, block in enumerate(data.get(\"content\") or []):\n        print(\"Content\", index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(\"choices\") or []:\n        print(\"Choice\", choice.get(\"index\"), json.dumps(choice.get(\"message\", choice.get(\"delta\", {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(\"output\") or []):\n        print(\"Output\", index, json.dumps(item, ensure_ascii=False))\n        if item.get(\"type\") == \"image_generation_call\" and item.get(\"result\"):\n            save_blob(item[\"result\"], item.get(\"output_format\") or \"bin\", \"output-\" + str(index))\n    for ci, candidate in enumerate(data.get(\"candidates\") or []):\n        for pi, part in enumerate((candidate.get(\"content\") or {}).get(\"parts\") or []):\n            print(\"Candidate/part\", ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(\"inlineData\") or part.get(\"inline_data\")\n            if blob and blob.get(\"data\"):\n                mime = blob.get(\"mimeType\") or blob.get(\"mime_type\")\n                suffix = {\"image/png\":\"png\", \"image/jpeg\":\"jpg\", \"image/webp\":\"webp\", \"audio/wav\":\"wav\", \"audio/mpeg\":\"mp3\", \"video/mp4\":\"mp4\"}.get(mime, \"bin\")\n                save_blob(blob[\"data\"], suffix, \"candidate-\" + str(ci) + \"-part-\" + str(pi))\n\nsave_result(result.to_dict(mode=\"json\"))\n",
            "label": "Python SDK · all choices",
            "language": "python"
          },
          {
            "code": "from openai import OpenAI\nimport os\nfrom pathlib import Path\n\nif not os.environ.get(\"AILOOT_API_KEY\", \"\").strip(): raise SystemExit(\"Set AILOOT_API_KEY before making a request\")\nclient=OpenAI(base_url=\"https://api.ailoot.ai/v1\",api_key=os.environ[\"AILOOT_API_KEY\"],max_retries=0)\nimport base64, json\nfrom pathlib import Path\n\ndef save_result(data, stem=\"result\"):\n    # Keep every field, including usage, IDs, reasoning and tool requests.\n    Path(stem + \".json\").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding=\"utf-8\")\n    print(json.dumps(data, ensure_ascii=False, indent=2))\n    def save_blob(encoded, suffix, label):\n        raw = base64.b64decode(encoded, altchars=b\"-_\", validate=True)\n        ext = \"png\" if raw.startswith(b\"\\x89PNG\\r\\n\\x1a\\n\") else \"jpg\" if raw.startswith(b\"\\xff\\xd8\") else \"webp\" if raw[:4] == b\"RIFF\" and raw[8:12] == b\"WEBP\" else suffix\n        file = Path(stem + \"-\" + label + \".\" + ext)\n        file.write_bytes(raw)\n        print(\"Saved\", file)\n    for index, block in enumerate(data.get(\"content\") or []):\n        print(\"Content\", index, json.dumps(block, ensure_ascii=False))\n    for choice in data.get(\"choices\") or []:\n        print(\"Choice\", choice.get(\"index\"), json.dumps(choice.get(\"message\", choice.get(\"delta\", {})), ensure_ascii=False))\n    for index, item in enumerate(data.get(\"output\") or []):\n        print(\"Output\", index, json.dumps(item, ensure_ascii=False))\n        if item.get(\"type\") == \"image_generation_call\" and item.get(\"result\"):\n            save_blob(item[\"result\"], item.get(\"output_format\") or \"bin\", \"output-\" + str(index))\n    for ci, candidate in enumerate(data.get(\"candidates\") or []):\n        for pi, part in enumerate((candidate.get(\"content\") or {}).get(\"parts\") or []):\n            print(\"Candidate/part\", ci, pi, json.dumps(part, ensure_ascii=False))\n            blob = part.get(\"inlineData\") or part.get(\"inline_data\")\n            if blob and blob.get(\"data\"):\n                mime = blob.get(\"mimeType\") or blob.get(\"mime_type\")\n                suffix = {\"image/png\":\"png\", \"image/jpeg\":\"jpg\", \"image/webp\":\"webp\", \"audio/wav\":\"wav\", \"audio/mpeg\":\"mp3\", \"video/mp4\":\"mp4\"}.get(mime, \"bin\")\n                save_blob(blob[\"data\"], suffix, \"candidate-\" + str(ci) + \"-part-\" + str(pi))\n\nwith client.chat.completions.stream(model='hunyuan-code',messages=[{\"role\":\"user\",\"content\":\"Explain observations and hypotheses in three sentences.\"}]) as stream:\n    with Path(\"stream-events.jsonl\").open(\"w\",encoding=\"utf-8\") as log:\n        for event in stream:\n            payload=event.to_dict(mode=\"json\")\n            log.write(json.dumps(payload,ensure_ascii=False)+\"\\n\"); log.flush()\n            print(json.dumps(payload,ensure_ascii=False))\n    final=stream.get_final_completion()\n    save_result(final.to_dict(mode=\"json\"),\"stream-result\")\n",
            "label": "Python SDK streaming · all events",
            "language": "python"
          }
        ],
        "family": "openai",
        "fast_multiplier": null,
        "flex_multiplier": null,
        "fmt": "chat",
        "hints": [
          "Send exact model ID with messages.",
          "Context length is not an output cap.",
          "A text file may supply literal text; image/audio/file-object inputs need exact binding."
        ],
        "http": "POST",
        "in": 1.254,
        "input": [
          "text"
        ],
        "label": "OpenAI Chat",
        "max_out": null,
        "max_reasoning_effort_multiplier": null,
        "method_aliases": [],
        "out": 2.508,
        "output": [
          "text"
        ],
        "path": "/v1/chat/completions",
        "price_conditions": [
          {
            "label": "Fast mode",
            "value": "Not specified",
            "when": "When fast mode is selected"
          },
          {
            "label": "Flex mode",
            "value": "Not specified",
            "when": "When flex mode is selected"
          },
          {
            "label": "Maximum reasoning effort",
            "value": "Not specified",
            "when": "When maximum reasoning effort uses the default adjustment"
          }
        ],
        "pricing": {
          "billing_mode": "token",
          "image_input_price": null,
          "image_output_price": null,
          "per_request_price": null
        },
        "pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Base token rates",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra",
        "status_reads": [],
        "tiers": [],
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      },
      {
        "available": null,
        "cache_read": 0,
        "cache_write": 0,
        "cache_write_1h": null,
        "contract": {
          "data": {
            "authentication": {
              "api_key_source": "AILOOT_API_KEY",
              "headers": [
                "Authorization: Bearer",
                "x-api-key",
                "anthropic-version"
              ],
              "version_example": "2023-06-01"
            },
            "errors": [
              {
                "code": null,
                "condition": "Champs obligatoires, représentation des éléments fournis ou valeur de paramètre invalides",
                "http_status": 400,
                "recovery": "Corrigez les champs indiqués avant une nouvelle requête de création.",
                "type": "invalid_request_error"
              }
            ],
            "example_body": {
              "max_tokens": 128,
              "messages": [
                {
                  "content": "Summarize the incident report.",
                  "role": "user"
                }
              ],
              "model": "hunyuan-code",
              "stream": false
            },
            "lifecycle": {
              "create": {
                "http": "POST",
                "path": "/v1/messages"
              },
              "job_read": null,
              "mode": "synchronous_or_streamed",
              "unknown": "Conservez les ID et les en-têtes de requête/réponse. Aucune URL générique de récupération de tâche textuelle n’est fournie."
            },
            "material_combinations": [
              {
                "mode": "text",
                "representation": "Chaîne messages[].content",
                "required_material": "Texte UTF-8"
              }
            ],
            "operation_modes": [
              "synchronous_json",
              "streamed_SSE"
            ],
            "outputs": {
              "all_results": "Conservez tous les blocs de contenu, les signatures de raisonnement et les ID réels d’utilisation d’outils. Assemblez tous les deltas de blocs SSE ; un premier bloc de texte ne constitue pas la sortie complète.",
              "family": "protocol",
              "fields": [
                {
                  "description": null,
                  "name": "id",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "model",
                  "type": "string"
                },
                {
                  "description": null,
                  "name": "content[]",
                  "type": "text|thinking|tool_use|other content block"
                },
                {
                  "description": null,
                  "name": "stop_reason",
                  "type": "string|null"
                },
                {
                  "description": null,
                  "name": "usage",
                  "type": "object"
                }
              ],
              "format": "JSON ou SSE"
            },
            "parameters": [
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "hunyuan-code"
                ],
                "enum_known": true,
                "name": "model",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages",
                "required": true,
                "type": "message[]"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": [
                  "user",
                  "assistant"
                ],
                "enum_known": true,
                "name": "messages[].role",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "messages[].content",
                "required": true,
                "type": "string"
              },
              {
                "availability": "source_interface",
                "default": null,
                "default_known": false,
                "enum": null,
                "enum_known": false,
                "name": "max_tokens",
                "required": true,
                "type": "integer"
              },
              {
                "availability": "source_interface",
                "default": false,
                "default_known": true,
                "enum": null,
                "enum_known": false,
                "name": "stream",
                "required": false,
                "type": "boolean"
              }
            ],
            "profile_binding": "Documented current stock Messages bridge; optional model capabilities are separate from this minimal text request.",
            "request_schema": {
              "additionalProperties": false,
              "properties": {
                "max_tokens": {
                  "minimum": 1,
                  "type": "integer"
                },
                "messages": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "content": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "items": {
                              "oneOf": [
                                {
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "const": "text"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "text"
                                  ],
                                  "type": "object"
                                },
                                {
                                  "properties": {
                                    "source": {
                                      "oneOf": [
                                        {
                                          "properties": {
                                            "type": {
                                              "const": "url"
                                            },
                                            "url": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "url"
                                          ],
                                          "type": "object"
                                        },
                                        {
                                          "properties": {
                                            "data": {
                                              "type": "string"
                                            },
                                            "media_type": {
                                              "type": "string"
                                            },
                                            "type": {
                                              "const": "base64"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "media_type",
                                            "data"
                                          ],
                                          "type": "object"
                                        }
                                      ]
                                    },
                                    "type": {
                                      "const": "image"
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "source"
                                  ],
                                  "type": "object"
                                }
                              ]
                            },
                            "type": "array"
                          }
                        ]
                      },
                      "role": {
                        "enum": [
                          "user",
                          "assistant"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "role",
                      "content"
                    ],
                    "type": "object"
                  },
                  "minItems": 1,
                  "type": "array"
                },
                "model": {
                  "enum": [
                    "hunyuan-code"
                  ],
                  "type": "string"
                },
                "stream": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "model",
                "messages",
                "max_tokens"
              ],
              "type": "object"
            },
            "schema_template": {
              "max_tokens": 128,
              "messages": [
                {
                  "content": "Summarize the incident report.",
                  "role": "user"
                }
              ],
              "model": "hunyuan-code",
              "stream": false
            },
            "unsupported": [
              "No query API key.",
              "Hosted/server-side tools and model-specific optional controls are not part of this minimal family example."
            ]
          },
          "input": {
            "content_type": "application/json",
            "material_types": [
              "text"
            ],
            "optional_controls": [
              "stream"
            ],
            "required": [
              "model",
              "messages",
              "max_tokens"
            ],
            "text_file_material": "Lisez le document UTF-8 réel et placez son texte dans l’entrée indiquée ou dans la chaîne de contenu du message."
          },
          "lifecycle": {
            "create": {
              "http": "POST",
              "path": "/v1/messages"
            },
            "job_read": null,
            "mode": "synchronous_or_streamed",
            "unknown": "Keep request/response IDs and headers. No generic text job retrieval URL is supplied."
          },
          "manufacturer_capability": null,
          "method": {
            "http": "POST",
            "path": "/v1/messages"
          },
          "output": {
            "all_results": "Keep all content blocks, thinking signatures and actual tool-use IDs. Assemble all SSE block deltas; a first text block is not the complete output.",
            "family": "protocol",
            "format": "JSON or SSE"
          }
        },
        "ctx": null,
        "declared_pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Tarifs de base des jetons",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "examples": [
          {
            "code": "{\n  \"model\": \"hunyuan-code\",\n  \"max_tokens\": 128,\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Summarize the incident report.\"\n    }\n  ],\n  \"stream\": false\n}",
            "label": "Complete minimal JSON body",
            "language": "json"
          },
          {
            "code": "set -eu\n: \"${AILOOT_API_KEY:?Set your Ailoot API key}\"\n: \"${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}\"\nexport AILOOT_TEXT_FILE\npython3 - <<'PY_REQUEST'\nimport json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ['AILOOT_TEXT_FILE'])\nif not source_file.is_file():\n    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')\ntext = source_file.read_text(encoding='utf-8')\nif not text.strip():\n    raise SystemExit('Choose a document containing text')\npayload = {'model': 'hunyuan-code', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}\npayload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\\n\\n' + text\nPath('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')\nPY_REQUEST\ncurl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \\\n  -H \"x-api-key: $AILOOT_API_KEY\" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \\\n  --data-binary @request.json -D response-headers.txt -o result.json\npython3 - <<'PY_RESULT'\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path('result.json').read_text(encoding='utf-8'))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\nPY_RESULT\n",
            "label": "curl · use your UTF-8 document",
            "language": "bash"
          },
          {
            "code": "import json, os\nfrom pathlib import Path\n\nsource_file = Path(os.environ['AILOOT_TEXT_FILE'])\nif not source_file.is_file():\n    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')\ntext = source_file.read_text(encoding='utf-8')\nif not text.strip():\n    raise SystemExit('Choose a document containing text')\npayload = {'model': 'hunyuan-code', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}\npayload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\\n\\n' + text\nfrom urllib.request import Request, urlopen\nfrom urllib.error import HTTPError\n\napi_key = os.environ['AILOOT_API_KEY']\nif not api_key.strip():\n    raise SystemExit('Set AILOOT_API_KEY before making a request')\nheaders = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}\nheaders['x-api-key'] = api_key\nrequest = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')\ntry:\n    with urlopen(request, timeout=120) as response:\n        raw = response.read()\n        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')\nexcept HTTPError as error:\n    Path('result.json').write_bytes(error.read())\n    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')\n    raise\nPath('result.json').write_bytes(raw)\nimport json\nfrom pathlib import Path\n\nresult = json.loads(Path('result.json').read_text(encoding='utf-8'))\nprint(json.dumps(result, ensure_ascii=False, indent=2))\n",
            "label": "Python · save the complete result",
            "language": "python"
          }
        ],
        "family": "anthropic",
        "fast_multiplier": null,
        "flex_multiplier": null,
        "fmt": "messages",
        "http": "POST",
        "in": 1.254,
        "input": [
          "text"
        ],
        "label": "Anthropic Messages",
        "max_out": null,
        "max_reasoning_effort_multiplier": null,
        "method_aliases": [],
        "out": 2.508,
        "output": [
          "json",
          "sse"
        ],
        "path": "/v1/messages",
        "price_conditions": [
          {
            "label": "Fast mode",
            "value": "Not specified",
            "when": "When fast mode is selected"
          },
          {
            "label": "Flex mode",
            "value": "Not specified",
            "when": "When flex mode is selected"
          },
          {
            "label": "Maximum reasoning effort",
            "value": "Not specified",
            "when": "When maximum reasoning effort uses the default adjustment"
          }
        ],
        "pricing": {
          "billing_mode": "token",
          "image_input_price": null,
          "image_output_price": null,
          "per_request_price": null
        },
        "pricing_profiles": [
          {
            "dimensions": {
              "regime": "base"
            },
            "label": "Base token rates",
            "units": [
              {
                "amount": "0.001254000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "input_price",
                "label": "Input tokens",
                "native_amount_usd_per_unit": "0.000001254",
                "native_quantity": 1,
                "native_unit": "input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "input_token"
              },
              {
                "amount": "0.002508000",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "output_price",
                "label": "Output tokens",
                "native_amount_usd_per_unit": "0.000002508",
                "native_quantity": 1,
                "native_unit": "output_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "out",
                "unit": "output_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_read_price",
                "label": "Cache read",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "cached_input_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "cached_input_token"
              },
              {
                "amount": "0",
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_price",
                "label": "Cache write",
                "native_amount_usd_per_unit": "0",
                "native_quantity": 1,
                "native_unit": "generic_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "generic_cache_creation_token"
              },
              {
                "amount": null,
                "amount_unit": "usd_per_thousand_tokens",
                "billing_input": true,
                "estimate_only": false,
                "key": "cache_write_1h_price",
                "label": "Cache write, 1 hour",
                "native_amount_usd_per_unit": null,
                "native_quantity": 1,
                "native_unit": "one_hour_cache_creation_token",
                "public_unit_label": "/ 1K tokens",
                "quantity": 1000,
                "quantity_is_estimate": false,
                "rate_role": "typed_native_retail_rate",
                "side": "in",
                "unit": "one_hour_cache_creation_token"
              }
            ]
          }
        ],
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra",
        "status_reads": [],
        "tiers": [],
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      }
    ],
    "model_aliases": [
      {
        "canonical_model_id": "hunyuan-code",
        "request_model_id": "hunyuan-code",
        "route_label": "Ultra"
      }
    ],
    "name": "Hunyuan-Code",
    "price": {
      "in": 1.254,
      "in_label": null,
      "out": 2.508,
      "out_label": null,
      "scope_label": "Token rates",
      "sort_in": 1.254,
      "sort_out": 2.508,
      "varies": false
    },
    "pricing_profiles": [
      {
        "dimensions": {
          "regime": "base"
        },
        "label": "OpenAI Chat · Base token rates",
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      },
      {
        "dimensions": {
          "regime": "base"
        },
        "label": "Anthropic Messages · Base token rates",
        "units": [
          {
            "amount": "0.001254000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "input_price",
            "label": "Input tokens",
            "native_amount_usd_per_unit": "0.000001254",
            "native_quantity": 1,
            "native_unit": "input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "input_token"
          },
          {
            "amount": "0.002508000",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "output_price",
            "label": "Output tokens",
            "native_amount_usd_per_unit": "0.000002508",
            "native_quantity": 1,
            "native_unit": "output_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "out",
            "unit": "output_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_read_price",
            "label": "Cache read",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "cached_input_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "cached_input_token"
          },
          {
            "amount": "0",
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_price",
            "label": "Cache write",
            "native_amount_usd_per_unit": "0",
            "native_quantity": 1,
            "native_unit": "generic_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "generic_cache_creation_token"
          },
          {
            "amount": null,
            "amount_unit": "usd_per_thousand_tokens",
            "billing_input": true,
            "estimate_only": false,
            "key": "cache_write_1h_price",
            "label": "Cache write, 1 hour",
            "native_amount_usd_per_unit": null,
            "native_quantity": 1,
            "native_unit": "one_hour_cache_creation_token",
            "public_unit_label": "/ 1K tokens",
            "quantity": 1000,
            "quantity_is_estimate": false,
            "rate_role": "typed_native_retail_rate",
            "side": "in",
            "unit": "one_hour_cache_creation_token"
          }
        ]
      }
    ],
    "public_id": "hunyuan-code",
    "short": "Hunyuan Code est le profil de conversation Hunyuan de Tencent orienté vers la programmation, avec un contexte indiqué de 4 000 jetons. Fournissez un extrait de code délimité et le comportement prévu, puis indiquez si vous avez besoin d’une implémentation, d’une explication ou d’une correction."
  },
  "renderer_schema": {
    "method_order": "Original DTO methods order; every exact route/format/path/caller survives.",
    "prices": "Original public DTO fields and original native display HTML; no flattened or normalized offers."
  },
  "representation": "exact-public-dto-and-native-renderer-html",
  "representationNotes": {
    "current_reference": {
      "about_json_pointer": "/aboutHtml",
      "methods": [
        {
          "contract_json_pointer": "/methods/0/rawMethod/contract",
          "html_json_pointer": "/methods/0/html",
          "method_ordinal": 0
        },
        {
          "contract_json_pointer": "/methods/1/rawMethod/contract",
          "html_json_pointer": "/methods/1/html",
          "method_ordinal": 1
        }
      ],
      "role": "current-semantic-reference"
    },
    "raw_input": {
      "examples_role": "historical-input-not-current-ready-examples",
      "json_pointers": [
        "/rawModel",
        "/methods/0/rawMethod",
        "/methods/1/rawMethod"
      ],
      "role": "historical-owner-input"
    },
    "schema": "ailoot-native-model-representations-v1"
  },
  "schema": "ailoot-static-model-facts-v1",
  "schema_version": 1,
  "shortText": "Hunyuan Code est le profil de conversation Hunyuan de Tencent orienté vers la programmation, avec un contexte indiqué de 4 000 jetons. Fournissez un extrait de code délimité et le comportement prévu, puis indiquez si vous avez besoin d’une implémentation, d’une explication ou d’une correction.",
  "source": {
    "audit_sha256": "2e00086bcbfc28e64d0cebe97aa47c17d8d5618963027f8ffb9dc6123d7d25b1",
    "bridge_map_sha256": "1125275768b9636fc8461bc7da5061239a81ddfe508e2557843ca42c58ab0036",
    "raw_model_json_sha256": "86028a6b24f6a080b756027dad4ab000734fa52bdf28025a8bbff3eeba786f75",
    "renderer_sha256": "98cb81b9c4ef4923c22e586170e7cdf67056351148a1666fb03dd6a4a26716a3"
  },
  "sourceRevision": "f84fbe0f587b55c60d8d19f1302e776dbf1570aa18b2ebd047aff3860a18b0ea"
}
