From f335a441aff2a23d07c33643a7d0aef2c6eab52e Mon Sep 17 00:00:00 2001 From: maddy-a <275.madhu@gmail.com> Date: Tue, 28 Jul 2026 11:19:24 -0500 Subject: [PATCH] added api ref only for chat completion --- api-reference/models/deepseek-v4-flash.mdx | 16 ++ api-reference/models/glm-5-2.mdx | 16 ++ .../deepseek-v4-flash.openapi.json | 217 ++++++++++++++++++ .../openapi/playgrounds/glm-5_2.openapi.json | 217 ++++++++++++++++++ 4 files changed, 466 insertions(+) create mode 100644 api-reference/models/deepseek-v4-flash.mdx create mode 100644 api-reference/models/glm-5-2.mdx create mode 100644 api-reference/openapi/playgrounds/deepseek-v4-flash.openapi.json create mode 100644 api-reference/openapi/playgrounds/glm-5_2.openapi.json diff --git a/api-reference/models/deepseek-v4-flash.mdx b/api-reference/models/deepseek-v4-flash.mdx new file mode 100644 index 0000000..ea91b6b --- /dev/null +++ b/api-reference/models/deepseek-v4-flash.mdx @@ -0,0 +1,16 @@ +--- +title: "deepseek-v4-flash" +sidebarTitle: "deepseek-v4-flash" +description: "Model details for deepseek-v4-flash. Reasoning, coding, and agentic workflows with a 1M-token context window." +openapi: "api-reference/openapi/playgrounds/deepseek-v4-flash.openapi.json POST /chat/completions" +--- + + + This model supports the Chat Completions API only. Send requests to + `/v1/chat/completions` — the Responses endpoint (`/v1/responses`) is not + available for this model. + + +> DeepSeek's DeepSeek-V4-Flash is an open-weight Mixture-of-Experts model built for efficient reasoning, coding, and agentic workflows, with 284B total parameters activating only 13B per token, served on ZeroGPU for general text generation. It sustains a 1,048,576-token (1M) context well suited for analyzing large codebases, long documents, extensive conversations, and complex research tasks, and supports fast non-thinking responses as well as higher-effort reasoning modes for planning, problem-solving, and multi-step automation. MIT-licensed with no usage restrictions. + +**References:** [Model docs](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash) • [Terms](https://zerogpu.ai/terms) • [Privacy](https://zerogpu.ai/privacy-policy) diff --git a/api-reference/models/glm-5-2.mdx b/api-reference/models/glm-5-2.mdx new file mode 100644 index 0000000..ebfae3c --- /dev/null +++ b/api-reference/models/glm-5-2.mdx @@ -0,0 +1,16 @@ +--- +title: "glm-5.2" +sidebarTitle: "glm-5.2" +description: "Model details for glm-5.2. Reasoning, function calling, and batch tasks with a 1M-token context window." +openapi: "api-reference/openapi/playgrounds/glm-5_2.openapi.json POST /chat/completions" +--- + + + This model supports the Chat Completions API only. Send requests to + `/v1/chat/completions` — the Responses endpoint (`/v1/responses`) is not + available for this model. + + +> Z.ai's GLM-5.2 is an open-weight Mixture-of-Experts flagship built for long-horizon tasks, with 753B total parameters activating 8 of 256 experts per token, served on ZeroGPU for general text generation. It sustains a solid 1,048,576-token (1M) context, reasons through a problem with flexible thinking effort before answering, and supports function calling and batch tasks. MIT-licensed with no usage restrictions. When the work spans entire repos, day-long agent sessions, or million-token documents, this is the model. + +**References:** [Model docs](https://huggingface.co/zai-org/GLM-5.2) • [Terms](https://zerogpu.ai/terms) • [Privacy](https://zerogpu.ai/privacy-policy) diff --git a/api-reference/openapi/playgrounds/deepseek-v4-flash.openapi.json b/api-reference/openapi/playgrounds/deepseek-v4-flash.openapi.json new file mode 100644 index 0000000..b52f567 --- /dev/null +++ b/api-reference/openapi/playgrounds/deepseek-v4-flash.openapi.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "deepseek-v4-flash playground", + "version": "1.0", + "description": "Interactive playground for **deepseek-v4-flash**.\nModel is always `deepseek-v4-flash` on this page (shown in the form, not editable).\nUse the **request example** selector to switch use cases (JSON, NER, PII, etc.).\nAuthentication: `x-api-key` (required) and `x-project-id` (optional)." + }, + "servers": [ + { + "url": "https://api.zerogpu.ai/v1", + "description": "Production" + } + ], + "security": [ + { + "ApiKey": [] + } + ], + "paths": { + "/chat/completions": { + "post": { + "operationId": "createChatCompletion_deepseek-v4-flash", + "summary": "deepseek-v4-flash: Chat completions", + "tags": [ + "deepseek-v4-flash" + ], + "parameters": [ + { + "name": "x-project-id", + "in": "header", + "required": false, + "schema": { + "type": "string" + }, + "description": "Optional project identifier. Scopes the request to a specific project when provided." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateChatCompletionRequest" + }, + { + "type": "object", + "properties": { + "model": { + "type": "string", + "const": "deepseek-v4-flash", + "default": "deepseek-v4-flash", + "example": "deepseek-v4-flash", + "description": "Model identifier (fixed for this playground). Use request examples to change use cases." + } + } + } + ] + }, + "examples": { + "default": { + "summary": "Default", + "value": { + "model": "deepseek-v4-flash", + "messages": [ + { + "role": "system", + "content": "You are a pragmatic staff engineer. Be concise." + }, + { + "role": "user", + "content": "Plan the migration of a nightly cron-based ETL job to an event-driven pipeline. 4 steps max." + } + ], + "max_tokens": 800 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChatCompletionResponse" + }, + "examples": { + "default": { + "summary": "Default", + "value": { + "id": "id-1785523944762", + "object": "chat.completion", + "created": 1785523944, + "model": "deepseek-v4-flash", + "choices": [ + { + "index": 0, + "finish_reason": "stop", + "message": { + "role": "assistant", + "content": "**1. Inventory the job** – Document inputs, outputs, schedule, and every downstream consumer of the cron ETL so nothing breaks silently.\n\n**2. Define the events** – Pick the real trigger (file landing, DB change, message) and publish it to a queue or event bus with a versioned schema.\n\n**3. Run in parallel** – Build the event-driven consumer alongside cron, write to a shadow table, and diff outputs until they match.\n\n**4. Cut over with a rollback path** – Point consumers at the new output, keep cron paused (not deleted) for one cycle, then decommission.", + "reasoning": "Cron ETL to event-driven: inventory the current job first, define the trigger events, run the new pipeline in parallel against a shadow output, then cut over with a rollback path. Four steps, each actionable.", + "tool_calls": [] + } + } + ], + "usage": { + "prompt_tokens": 52, + "completion_tokens": 158, + "total_tokens": 210 + } + } + } + } + } + } + }, + "400": { + "description": "Bad request" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "420": { + "description": "Insufficient quota" + }, + "500": { + "description": "Internal server error" + } + } + } + } + }, + "components": { + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "in": "header", + "name": "x-api-key" + } + }, + "schemas": { + "CreateChatCompletionRequest": { + "type": "object", + "required": [ + "model", + "messages" + ], + "properties": { + "model": { + "type": "string", + "const": "deepseek-v4-flash", + "default": "deepseek-v4-flash", + "example": "deepseek-v4-flash", + "description": "Model identifier (fixed for this playground). Use request examples to change use cases." + }, + "messages": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/components/schemas/ChatMessage" + } + }, + "max_tokens": { + "type": "integer", + "minimum": 1, + "example": 800, + "description": "Maximum number of tokens to generate in the response." + }, + "metadata": { + "type": "object", + "additionalProperties": true + } + } + }, + "ChatMessage": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "system", + "user", + "assistant" + ] + }, + "content": { + "type": "string", + "minLength": 1, + "format": "textarea", + "maxLength": 131072, + "description": "Message text." + } + } + }, + "ChatCompletionResponse": { + "type": "object", + "additionalProperties": true + }, + "ErrorResponse": { + "type": "object", + "additionalProperties": true + } + } + } +} diff --git a/api-reference/openapi/playgrounds/glm-5_2.openapi.json b/api-reference/openapi/playgrounds/glm-5_2.openapi.json new file mode 100644 index 0000000..8a6d95a --- /dev/null +++ b/api-reference/openapi/playgrounds/glm-5_2.openapi.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "glm-5.2 playground", + "version": "1.0", + "description": "Interactive playground for **glm-5.2**.\nModel is always `glm-5.2` on this page (shown in the form, not editable).\nUse the **request example** selector to switch use cases (JSON, NER, PII, etc.).\nAuthentication: `x-api-key` (required) and `x-project-id` (optional)." + }, + "servers": [ + { + "url": "https://api.zerogpu.ai/v1", + "description": "Production" + } + ], + "security": [ + { + "ApiKey": [] + } + ], + "paths": { + "/chat/completions": { + "post": { + "operationId": "createChatCompletion_glm-5.2", + "summary": "glm-5.2: Chat completions", + "tags": [ + "glm-5.2" + ], + "parameters": [ + { + "name": "x-project-id", + "in": "header", + "required": false, + "schema": { + "type": "string" + }, + "description": "Optional project identifier. Scopes the request to a specific project when provided." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CreateChatCompletionRequest" + }, + { + "type": "object", + "properties": { + "model": { + "type": "string", + "const": "glm-5.2", + "default": "glm-5.2", + "example": "glm-5.2", + "description": "Model identifier (fixed for this playground). Use request examples to change use cases." + } + } + } + ] + }, + "examples": { + "default": { + "summary": "Default", + "value": { + "model": "glm-5.2", + "messages": [ + { + "role": "system", + "content": "You are a precise code-review assistant. Be brief." + }, + { + "role": "user", + "content": "Review this function name: getUserDataAndSendEmailAndLog(). What does it tell you about the function, and how would you refactor it? 3 bullets max." + } + ], + "max_tokens": 800 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChatCompletionResponse" + }, + "examples": { + "default": { + "summary": "Default", + "value": { + "id": "id-1784840133815", + "object": "chat.completion", + "created": 1784840133, + "model": "glm-5.2", + "choices": [ + { + "index": 0, + "finish_reason": "stop", + "message": { + "role": "assistant", + "content": "**1. The name confesses the crime** – \"And\" in a function name means it violates single responsibility: fetching, emailing, and logging are three separate concerns.\n\n**2. Split it** – Extract `getUserData()`, `sendEmail()`, and `logActivity()`, each independently testable and reusable.\n\n**3. Orchestrate at the edge** – If the sequence matters, compose them in a thin workflow function named for the *why* (e.g. `onUserSignup()`), not the *how*.", + "reasoning": "The name reveals the function does three unrelated things — fetch data, send email, log — a single-responsibility violation. Recommend splitting into three functions plus a thin orchestrator. Keep to 3 bullets.", + "tool_calls": [] + } + } + ], + "usage": { + "prompt_tokens": 58, + "completion_tokens": 151, + "total_tokens": 209 + } + } + } + } + } + } + }, + "400": { + "description": "Bad request" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "420": { + "description": "Insufficient quota" + }, + "500": { + "description": "Internal server error" + } + } + } + } + }, + "components": { + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "in": "header", + "name": "x-api-key" + } + }, + "schemas": { + "CreateChatCompletionRequest": { + "type": "object", + "required": [ + "model", + "messages" + ], + "properties": { + "model": { + "type": "string", + "const": "glm-5.2", + "default": "glm-5.2", + "example": "glm-5.2", + "description": "Model identifier (fixed for this playground). Use request examples to change use cases." + }, + "messages": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/components/schemas/ChatMessage" + } + }, + "max_tokens": { + "type": "integer", + "minimum": 1, + "example": 800, + "description": "Maximum number of tokens to generate in the response." + }, + "metadata": { + "type": "object", + "additionalProperties": true + } + } + }, + "ChatMessage": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "system", + "user", + "assistant" + ] + }, + "content": { + "type": "string", + "minLength": 1, + "format": "textarea", + "maxLength": 131072, + "description": "Message text." + } + } + }, + "ChatCompletionResponse": { + "type": "object", + "additionalProperties": true + }, + "ErrorResponse": { + "type": "object", + "additionalProperties": true + } + } + } +}