Skip to content

Conversation

zdql
Copy link
Contributor

@zdql zdql commented Sep 29, 2025

Returns a formalized Zod schema detailing what models can be passed to the chat completions endpoint, and returns this in the "accepts" array on the 402 payment challenge.

Allows a user hitting the endpoint to correctly format a request to receive a chat model response from the echo router.

Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
assistant-ui-template Ready Ready Preview Comment Sep 29, 2025 7:47pm
echo-control Ready Ready Preview Comment Sep 29, 2025 7:47pm
echo-next-boilerplate Ready Ready Preview Comment Sep 29, 2025 7:47pm
echo-next-image Ready Ready Preview Comment Sep 29, 2025 7:47pm
echo-next-sdk-example Ready Ready Preview Comment Sep 29, 2025 7:47pm
echo-vite-sdk-example Ready Ready Preview Comment Sep 29, 2025 7:47pm
next-api-key-template Error Error Sep 29, 2025 7:47pm
next-chat-template Ready Ready Preview Comment Sep 29, 2025 7:47pm
react-boilerplate Ready Ready Preview Comment Sep 29, 2025 7:47pm
react-chat Ready Ready Preview Comment Sep 29, 2025 7:47pm
react-image Ready Ready Preview Comment Sep 29, 2025 7:47pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
component-registry Skipped Skipped Sep 29, 2025 7:47pm

@zdql
Copy link
Contributor Author

zdql commented Sep 29, 2025

Example response:

curl -X POST http://localhost:3070/v1/chat/completions
{
  "x402Version": 1,
  "error": "Payment Required",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "20000000",
      "resource": "http://localhost:3070//v1/chat/completions",
      "description": "Echo chat completions endpoint.",
      "mimeType": "application/json",
      "payTo": "http://localhost:3070//api/v1/base/payment-link?amount=20000000",
      "maxTimeoutSeconds": 5000,
      "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "outputSchema": {
        "input": {
          "type": "http",
          "method": "POST",
          "discoverable": true,
          "body": {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "enum": [
                  "gpt-3.5-turbo",
                  "gpt-3.5-turbo-0125",
                  "gpt-3.5-turbo-1106",
                  "gpt-4",
                  "gpt-4-0125-preview",
                  "gpt-4-0613",
                  "gpt-4-1106-preview",
                  "gpt-4-turbo",
                  "gpt-4-turbo-2024-04-09",
                  "gpt-4-turbo-preview",
                  "gpt-4.1",
                  "gpt-4.1-2025-04-14",
                  "gpt-4.1-mini",
                  "gpt-4.1-mini-2025-04-14",
                  "gpt-4.1-nano",
                  "gpt-4.1-nano-2025-04-14",
                  "gpt-4o",
                  "gpt-4o-2024-05-13",
                  "gpt-4o-2024-08-06",
                  "gpt-4o-2024-11-20",
                  "gpt-4o-mini",
                  "gpt-4o-mini-2024-07-18",
                  "gpt-5",
                  "gpt-5-2025-08-07",
                  "gpt-5-chat-latest",
                  "gpt-5-mini",
                  "gpt-5-mini-2025-08-07",
                  "gpt-5-nano",
                  "gpt-5-nano-2025-08-07",
                  "o1",
                  "o1-2024-12-17",
                  "o1-pro",
                  "o1-pro-2025-03-19",
                  "o3",
                  "o3-2025-04-16",
                  "o3-deep-research",
                  "o3-deep-research-2025-06-26",
                  "o3-mini",
                  "o3-mini-2025-01-31",
                  "o3-pro",
                  "o3-pro-2025-06-10",
                  "claude-3-5-haiku-20241022",
                  "claude-3-5-sonnet-20240620",
                  "claude-3-5-sonnet-20241022",
                  "claude-3-7-sonnet-20250219",
                  "claude-3-haiku-20240307",
                  "claude-3-opus-20240229",
                  "claude-opus-4-1-20250805",
                  "claude-opus-4-20250514",
                  "claude-sonnet-4-20250514",
                  "gemini-2.0-flash",
                  "gemini-2.0-flash-001",
                  "gemini-2.0-flash-exp",
                  "gemini-2.0-flash-exp-image-generation",
                  "gemini-2.0-flash-lite",
                  "gemini-2.0-flash-lite-001",
                  "gemini-2.0-flash-lite-preview",
                  "gemini-2.0-flash-lite-preview-02-05",
                  "gemini-2.0-flash-preview-image-generation",
                  "gemini-2.0-flash-thinking-exp",
                  "gemini-2.0-flash-thinking-exp-01-21",
                  "gemini-2.0-flash-thinking-exp-1219",
                  "gemini-2.5-flash",
                  "gemini-2.5-flash-image-preview",
                  "gemini-2.5-flash-lite",
                  "gemini-2.5-flash-lite-preview-06-17",
                  "gemini-2.5-flash-preview-05-20",
                  "gemini-2.5-flash-preview-tts",
                  "gemini-2.5-pro",
                  "gemini-2.5-pro-preview-03-25",
                  "gemini-2.5-pro-preview-05-06",
                  "gemini-2.5-pro-preview-06-05",
                  "gemini-2.5-pro-preview-tts",
                  "agentica-org/deepcoder-14b-preview",
                  "agentica-org/deepcoder-14b-preview:free",
                  "ai21/jamba-large-1.7",
                  "ai21/jamba-mini-1.7",
                  "aion-labs/aion-1.0",
                  "aion-labs/aion-1.0-mini",
                  "aion-labs/aion-rp-llama-3.1-8b",
                  "alfredpros/codellama-7b-instruct-solidity",
                  "alpindale/goliath-120b",
                  "amazon/nova-lite-v1",
                  "amazon/nova-micro-v1",
                  "amazon/nova-pro-v1",
                  "anthracite-org/magnum-v2-72b",
                  "anthracite-org/magnum-v4-72b",
                  "anthropic/claude-3-haiku",
                  "anthropic/claude-3-opus",
                  "anthropic/claude-3.5-haiku",
                  "anthropic/claude-3.5-haiku-20241022",
                  "anthropic/claude-3.5-sonnet",
                  "anthropic/claude-3.5-sonnet-20240620",
                  "anthropic/claude-3.7-sonnet",
                  "anthropic/claude-3.7-sonnet:thinking",
                  "anthropic/claude-opus-4",
                  "anthropic/claude-opus-4.1",
                  "anthropic/claude-sonnet-4",
                  "arcee-ai/coder-large",
                  "arcee-ai/maestro-reasoning",
                  "arcee-ai/spotlight",
                  "arcee-ai/virtuoso-large",
                  "arliai/qwq-32b-arliai-rpr-v1",
                  "arliai/qwq-32b-arliai-rpr-v1:free",
                  "baidu/ernie-4.5-21b-a3b",
                  "baidu/ernie-4.5-300b-a47b",
                  "baidu/ernie-4.5-vl-28b-a3b",
                  "baidu/ernie-4.5-vl-424b-a47b",
                  "bytedance/ui-tars-1.5-7b",
                  "cognitivecomputations/dolphin-mistral-24b-venice-edition:free",
                  "cognitivecomputations/dolphin-mixtral-8x22b",
                  "cognitivecomputations/dolphin3.0-mistral-24b",
                  "cognitivecomputations/dolphin3.0-mistral-24b:free",
                  "cognitivecomputations/dolphin3.0-r1-mistral-24b",
                  "cognitivecomputations/dolphin3.0-r1-mistral-24b:free",
                  "cohere/command",
                  "cohere/command-a",
                  "cohere/command-r",
                  "cohere/command-r-03-2024",
                  "cohere/command-r-08-2024",
                  "cohere/command-r-plus",
                  "cohere/command-r-plus-04-2024",
                  "cohere/command-r-plus-08-2024",
                  "cohere/command-r7b-12-2024",
                  "deepseek/deepseek-chat",
                  "deepseek/deepseek-chat-v3-0324",
                  "deepseek/deepseek-chat-v3-0324:free",
                  "deepseek/deepseek-chat-v3.1",
                  "deepseek/deepseek-prover-v2",
                  "deepseek/deepseek-r1",
                  "deepseek/deepseek-r1-0528",
                  "deepseek/deepseek-r1-0528-qwen3-8b",
                  "deepseek/deepseek-r1-0528-qwen3-8b:free",
                  "deepseek/deepseek-r1-0528:free",
                  "deepseek/deepseek-r1-distill-llama-70b",
                  "deepseek/deepseek-r1-distill-llama-70b:free",
                  "deepseek/deepseek-r1-distill-llama-8b",
                  "deepseek/deepseek-r1-distill-qwen-1.5b",
                  "deepseek/deepseek-r1-distill-qwen-14b",
                  "deepseek/deepseek-r1-distill-qwen-14b:free",
                  "deepseek/deepseek-r1-distill-qwen-32b",
                  "deepseek/deepseek-r1:free",
                  "deepseek/deepseek-v3.1-base",
                  "eleutherai/llemma_7b",
                  "google/gemini-2.0-flash-001",
                  "google/gemini-2.0-flash-exp:free",
                  "google/gemini-2.0-flash-lite-001",
                  "google/gemini-2.5-flash",
                  "google/gemini-2.5-flash-lite",
                  "google/gemini-2.5-flash-lite-preview-06-17",
                  "google/gemini-2.5-pro",
                  "google/gemini-2.5-pro-exp-03-25",
                  "google/gemini-2.5-pro-preview",
                  "google/gemini-2.5-pro-preview-05-06",
                  "google/gemini-flash-1.5",
                  "google/gemini-flash-1.5-8b",
                  "google/gemini-pro-1.5",
                  "google/gemma-2-27b-it",
                  "google/gemma-2-9b-it",
                  "google/gemma-2-9b-it:free",
                  "google/gemma-3-12b-it",
                  "google/gemma-3-12b-it:free",
                  "google/gemma-3-27b-it",
                  "google/gemma-3-27b-it:free",
                  "google/gemma-3-4b-it",
                  "google/gemma-3-4b-it:free",
                  "google/gemma-3n-e2b-it:free",
                  "google/gemma-3n-e4b-it",
                  "google/gemma-3n-e4b-it:free",
                  "gryphe/mythomax-l2-13b",
                  "inception/mercury",
                  "inception/mercury-coder",
                  "infermatic/mn-inferor-12b",
                  "inflection/inflection-3-pi",
                  "inflection/inflection-3-productivity",
                  "liquid/lfm-3b",
                  "liquid/lfm-7b",
                  "mancer/weaver",
                  "meta-llama/llama-3-70b-instruct",
                  "meta-llama/llama-3-8b-instruct",
                  "meta-llama/llama-3.1-405b",
                  "meta-llama/llama-3.1-405b-instruct",
                  "meta-llama/llama-3.1-405b-instruct:free",
                  "meta-llama/llama-3.1-70b-instruct",
                  "meta-llama/llama-3.1-8b-instruct",
                  "meta-llama/llama-3.2-11b-vision-instruct",
                  "meta-llama/llama-3.2-11b-vision-instruct:free",
                  "meta-llama/llama-3.2-1b-instruct",
                  "meta-llama/llama-3.2-3b-instruct",
                  "meta-llama/llama-3.2-3b-instruct:free",
                  "meta-llama/llama-3.2-90b-vision-instruct",
                  "meta-llama/llama-3.3-70b-instruct",
                  "meta-llama/llama-3.3-70b-instruct:free",
                  "meta-llama/llama-3.3-8b-instruct:free",
                  "meta-llama/llama-4-maverick",
                  "meta-llama/llama-4-maverick:free",
                  "meta-llama/llama-4-scout",
                  "meta-llama/llama-4-scout:free",
                  "meta-llama/llama-guard-2-8b",
                  "meta-llama/llama-guard-3-8b",
                  "meta-llama/llama-guard-4-12b",
                  "microsoft/mai-ds-r1",
                  "microsoft/mai-ds-r1:free",
                  "microsoft/phi-3-medium-128k-instruct",
                  "microsoft/phi-3-mini-128k-instruct",
                  "microsoft/phi-3.5-mini-128k-instruct",
                  "microsoft/phi-4",
                  "microsoft/phi-4-multimodal-instruct",
                  "microsoft/phi-4-reasoning-plus",
                  "microsoft/wizardlm-2-8x22b",
                  "minimax/minimax-01",
                  "minimax/minimax-m1",
                  "mistralai/codestral-2501",
                  "mistralai/codestral-2508",
                  "mistralai/devstral-medium",
                  "mistralai/devstral-small",
                  "mistralai/devstral-small-2505",
                  "mistralai/devstral-small-2505:free",
                  "mistralai/magistral-medium-2506",
                  "mistralai/magistral-medium-2506:thinking",
                  "mistralai/magistral-small-2506",
                  "mistralai/ministral-3b",
                  "mistralai/ministral-8b",
                  "mistralai/mistral-7b-instruct",
                  "mistralai/mistral-7b-instruct-v0.1",
                  "mistralai/mistral-7b-instruct-v0.3",
                  "mistralai/mistral-7b-instruct:free",
                  "mistralai/mistral-large",
                  "mistralai/mistral-large-2407",
                  "mistralai/mistral-large-2411",
                  "mistralai/mistral-medium-3",
                  "mistralai/mistral-medium-3.1",
                  "mistralai/mistral-nemo",
                  "mistralai/mistral-nemo:free",
                  "mistralai/mistral-saba",
                  "mistralai/mistral-small",
                  "mistralai/mistral-small-24b-instruct-2501",
                  "mistralai/mistral-small-24b-instruct-2501:free",
                  "mistralai/mistral-small-3.1-24b-instruct",
                  "mistralai/mistral-small-3.1-24b-instruct:free",
                  "mistralai/mistral-small-3.2-24b-instruct",
                  "mistralai/mistral-small-3.2-24b-instruct:free",
                  "mistralai/mistral-tiny",
                  "mistralai/mixtral-8x22b-instruct",
                  "mistralai/mixtral-8x7b-instruct",
                  "mistralai/pixtral-12b",
                  "mistralai/pixtral-large-2411",
                  "moonshotai/kimi-dev-72b:free",
                  "moonshotai/kimi-k2",
                  "moonshotai/kimi-k2:free",
                  "moonshotai/kimi-vl-a3b-thinking",
                  "moonshotai/kimi-vl-a3b-thinking:free",
                  "morph/morph-v3-fast",
                  "morph/morph-v3-large",
                  "neversleep/llama-3-lumimaid-70b",
                  "neversleep/llama-3.1-lumimaid-8b",
                  "neversleep/noromaid-20b",
                  "nousresearch/deephermes-3-llama-3-8b-preview:free",
                  "nousresearch/deephermes-3-mistral-24b-preview",
                  "nousresearch/hermes-2-pro-llama-3-8b",
                  "nousresearch/hermes-3-llama-3.1-405b",
                  "nousresearch/hermes-3-llama-3.1-70b",
                  "nousresearch/hermes-4-405b",
                  "nousresearch/hermes-4-70b",
                  "nousresearch/nous-hermes-2-mixtral-8x7b-dpo",
                  "nvidia/llama-3.1-nemotron-70b-instruct",
                  "nvidia/llama-3.1-nemotron-ultra-253b-v1",
                  "nvidia/llama-3.1-nemotron-ultra-253b-v1:free",
                  "nvidia/llama-3.3-nemotron-super-49b-v1",
                  "openai/chatgpt-4o-latest",
                  "openai/codex-mini",
                  "openai/gpt-3.5-turbo",
                  "openai/gpt-3.5-turbo-0613",
                  "openai/gpt-3.5-turbo-16k",
                  "openai/gpt-3.5-turbo-instruct",
                  "openai/gpt-4",
                  "openai/gpt-4-0314",
                  "openai/gpt-4-1106-preview",
                  "openai/gpt-4-turbo",
                  "openai/gpt-4-turbo-preview",
                  "openai/gpt-4.1",
                  "openai/gpt-4.1-mini",
                  "openai/gpt-4.1-nano",
                  "openai/gpt-4o",
                  "openai/gpt-4o-2024-05-13",
                  "openai/gpt-4o-2024-08-06",
                  "openai/gpt-4o-2024-11-20",
                  "openai/gpt-4o-audio-preview",
                  "openai/gpt-4o-mini",
                  "openai/gpt-4o-mini-2024-07-18",
                  "openai/gpt-4o-mini-search-preview",
                  "openai/gpt-4o-search-preview",
                  "openai/gpt-4o:extended",
                  "openai/gpt-5",
                  "openai/gpt-5-chat",
                  "openai/gpt-5-mini",
                  "openai/gpt-5-nano",
                  "openai/gpt-oss-120b",
                  "openai/gpt-oss-20b",
                  "openai/gpt-oss-20b:free",
                  "openai/o1",
                  "openai/o1-mini",
                  "openai/o1-mini-2024-09-12",
                  "openai/o1-pro",
                  "openai/o3",
                  "openai/o3-mini",
                  "openai/o3-mini-high",
                  "openai/o3-pro",
                  "openai/o4-mini",
                  "openai/o4-mini-high",
                  "opengvlab/internvl3-14b",
                  "openrouter/auto",
                  "perplexity/r1-1776",
                  "perplexity/sonar",
                  "perplexity/sonar-deep-research",
                  "perplexity/sonar-pro",
                  "perplexity/sonar-reasoning",
                  "perplexity/sonar-reasoning-pro",
                  "pygmalionai/mythalion-13b",
                  "qwen/qwen-2-72b-instruct",
                  "qwen/qwen-2.5-72b-instruct",
                  "qwen/qwen-2.5-72b-instruct:free",
                  "qwen/qwen-2.5-7b-instruct",
                  "qwen/qwen-2.5-coder-32b-instruct",
                  "qwen/qwen-2.5-coder-32b-instruct:free",
                  "qwen/qwen-2.5-vl-7b-instruct",
                  "qwen/qwen-max",
                  "qwen/qwen-plus",
                  "qwen/qwen-turbo",
                  "qwen/qwen-vl-max",
                  "qwen/qwen-vl-plus",
                  "qwen/qwen2.5-vl-32b-instruct",
                  "qwen/qwen2.5-vl-32b-instruct:free",
                  "qwen/qwen2.5-vl-72b-instruct",
                  "qwen/qwen2.5-vl-72b-instruct:free",
                  "qwen/qwen3-14b",
                  "qwen/qwen3-14b:free",
                  "qwen/qwen3-235b-a22b",
                  "qwen/qwen3-235b-a22b-2507",
                  "qwen/qwen3-235b-a22b-thinking-2507",
                  "qwen/qwen3-235b-a22b:free",
                  "qwen/qwen3-30b-a3b",
                  "qwen/qwen3-30b-a3b-instruct-2507",
                  "qwen/qwen3-30b-a3b:free",
                  "qwen/qwen3-32b",
                  "qwen/qwen3-4b:free",
                  "qwen/qwen3-8b",
                  "qwen/qwen3-8b:free",
                  "qwen/qwen3-coder",
                  "qwen/qwen3-coder:free",
                  "qwen/qwq-32b",
                  "qwen/qwq-32b-preview",
                  "qwen/qwq-32b:free",
                  "raifle/sorcererlm-8x22b",
                  "rekaai/reka-flash-3:free",
                  "sao10k/l3-euryale-70b",
                  "sao10k/l3-lunaris-8b",
                  "sao10k/l3.1-euryale-70b",
                  "sao10k/l3.3-euryale-70b",
                  "sarvamai/sarvam-m:free",
                  "scb10x/llama3.1-typhoon2-70b-instruct",
                  "shisa-ai/shisa-v2-llama3.3-70b",
                  "shisa-ai/shisa-v2-llama3.3-70b:free",
                  "sophosympatheia/midnight-rose-70b",
                  "switchpoint/router",
                  "tencent/hunyuan-a13b-instruct",
                  "tencent/hunyuan-a13b-instruct:free",
                  "thedrummer/anubis-70b-v1.1",
                  "thedrummer/anubis-pro-105b-v1",
                  "thedrummer/rocinante-12b",
                  "thedrummer/skyfall-36b-v2",
                  "thedrummer/unslopnemo-12b",
                  "thudm/glm-4-32b",
                  "thudm/glm-4.1v-9b-thinking",
                  "thudm/glm-z1-32b",
                  "tngtech/deepseek-r1t-chimera",
                  "tngtech/deepseek-r1t-chimera:free",
                  "tngtech/deepseek-r1t2-chimera:free",
                  "undi95/remm-slerp-l2-13b",
                  "x-ai/grok-2-1212",
                  "x-ai/grok-2-vision-1212",
                  "x-ai/grok-3",
                  "x-ai/grok-3-beta",
                  "x-ai/grok-3-mini",
                  "x-ai/grok-3-mini-beta",
                  "x-ai/grok-4",
                  "x-ai/grok-code-fast-1",
                  "x-ai/grok-vision-beta",
                  "z-ai/glm-4-32b",
                  "z-ai/glm-4.5",
                  "z-ai/glm-4.5-air",
                  "z-ai/glm-4.5-air:free",
                  "z-ai/glm-4.5v"
                ]
              },
              "messages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "enum": [
                        "system",
                        "user",
                        "assistant",
                        "function"
                      ]
                    },
                    "content": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "function_call": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "arguments": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "role"
                  ],
                  "additionalProperties": false
                }
              },
              "temperature": {
                "type": "number"
              },
              "top_p": {
                "type": "number"
              },
              "n": {
                "type": "number"
              },
              "stream": {
                "type": "boolean"
              },
              "stop": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              "max_tokens": {
                "type": "number"
              },
              "presence_penalty": {
                "type": "number"
              },
              "frequency_penalty": {
                "type": "number"
              },
              "logit_bias": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "functions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "parameters": {}
                  },
                  "required": [
                    "name"
                  ],
                  "additionalProperties": false
                }
              },
              "function_call": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "none",
                      "auto"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "response_format": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "json_schema"
                    ]
                  },
                  "json_schema": {}
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "model",
              "messages"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        "output": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "object": {
              "type": "string",
              "const": "chat.completion"
            },
            "created": {
              "type": "number"
            },
            "model": {
              "type": "string"
            },
            "choices": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "number"
                  },
                  "message": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string",
                        "enum": [
                          "system",
                          "user",
                          "assistant",
                          "function"
                        ]
                      },
                      "content": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "text": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "function_call": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "arguments": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "arguments"
                        ],
                        "additionalProperties": false
                      },
                      "tool_calls": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "function"
                              ]
                            },
                            "function": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "arguments": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "arguments"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "function"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "role",
                      "content"
                    ],
                    "additionalProperties": false
                  },
                  "finish_reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "stop",
                          "length",
                          "tool_calls",
                          "content_filter",
                          "function_call"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "logprobs": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "content": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "token": {
                                      "type": "string"
                                    },
                                    "logprob": {
                                      "type": "number"
                                    },
                                    "bytes": {
                                      "anyOf": [
                                        {
                                          "type": "array",
                                          "items": {
                                            "type": "number"
                                          }
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "top_logprobs": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "token": {
                                            "type": "string"
                                          },
                                          "logprob": {
                                            "type": "number"
                                          },
                                          "bytes": {
                                            "anyOf": [
                                              {
                                                "type": "array",
                                                "items": {
                                                  "type": "number"
                                                }
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "token",
                                          "logprob",
                                          "bytes"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "token",
                                    "logprob",
                                    "bytes"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "content"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "index",
                  "message",
                  "finish_reason"
                ],
                "additionalProperties": false
              }
            },
            "usage": {
              "type": "object",
              "properties": {
                "prompt_tokens": {
                  "type": "number"
                },
                "completion_tokens": {
                  "type": "number"
                },
                "total_tokens": {
                  "type": "number"
                },
                "completion_tokens_details": {
                  "type": "object",
                  "properties": {
                    "reasoning_tokens": {
                      "type": "number"
                    },
                    "accepted_prediction_tokens": {
                      "type": "number"
                    },
                    "rejected_prediction_tokens": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "prompt_tokens",
                "completion_tokens",
                "total_tokens"
              ],
              "additionalProperties": false
            },
            "system_fingerprint": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "object",
            "created",
            "model",
            "choices"
          ],
          "additionalProperties": false,
          "$schema": "http://json-schema.org/draft-07/schema#"
        }
      },
      "extra": {}
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant