1. API Reference
数游科技 API接口文档
  • API Reference
    • Create Chat Completion
      POST
    • 刷新缓存接口
      POST
    • Get generation
      GET
  • AIGC 模型接口
    • 接口文档说明
    • OpenAI
      • 对话补全接口
      • 对话响应接口
      • 图片生成接口
      • 图片编辑接口
      • 图片变化接口
      • 视频生成接口
      • 视频查询接口
      • 视频下载接口
      • 音频-TTS文本转语音
      • 音频-ASR语音转文本
      • 向量生成接口
    • Google
      • Gemini 生成内容接口
      • Gemini 生成内容流式回答接口
      • Veo 视频生成接口
    • Anthropic
      • 对话消息接口
  • 通用API接口
    • 通用接口
      POST
  • AI管理
    • 阿里云百炼
      • 通用文本向量同步接口
    • 通用--chat/completions-对话补全接口
      POST
    • Deepseek--beta/completions-FIM补全接口
      POST
    • OpenAI-images/generations-文生图
      POST
    • OpenAI-images/edits-图像编辑
      POST
    • OpenAI-images/variations-图片变形接口
      POST
    • OpenAI-embeddings-文本向量化
      POST
    • OpenAI-moderations-检查文本或图片是否违规接口
      POST
    • OpenAI-audio/speech-文本转语音接口
      POST
    • OpenAI-audio/transcriptions-语音转文本接口
      POST
    • OpenAI-audio/translations-语音翻译接口
      POST
    • 阿里通义万相-文生图接口
      POST
    • 阿里通义万相-通用图像编辑接口
      POST
    • 阿里通义万相-人像风格重绘接口
      POST
    • 阿里通义万相-图像背景生成接口
      POST
    • 阿里通义万相-人物写真生成接口
      POST
    • 阿里通义万相-文字变形接口
      POST
    • 阿里通义万相-文字纹理接口
      POST
    • 通义万相-图片查询接口
      GET
  • 测试第三方API接口
    • openrouter-openai/gpt-5.1
    • openrouter-google/gemini-2.5-flash-image-preview
    • openrouter-google/gemini-3-pro-image-preview
    • openrouter-google/gemini-3-pro-preview
    • poloapi-sora-2-pro
    • openrouter-x-ai/grok-4.1-fast
    • zenmux-google/gemini-3-pro-image-preview
    • zenmux-google/gemini-3-pro-preview-free
    • minimaxi-image-01
    • ploapi-FaceSwap
    • pollinations.ai
    • pollinations.ai Copy
    • http://dzenkkupvrkm.sealosbja.site:1337/
    • openrouter-google/gemini-2.5-flash-image-preview Copy
    • openrouter-openai/gpt-5.1 Copy
    • openrouter-openai/gpt-5.1 Copy
    • https://openrouter.ai/api/v1/generation
    • work.poloapi.com/gpt5.1
    • openrouter-openai/gpt-5.1---供应商key
    • https://openrouter.ai/api/v1/generation---供应商key
    • openrouter-openai/gpt-5.1 Copy Copy
    • openrouter-openai/gpt-5.1---供应商key Copy
    • api.openaius.com/grok-4.1-fast
    • api.openaius.com/gpt-5.1
    • api.openaius.com/gpt-5.1 Copy
    • Replicate接口
    • 未命名接口
    • Fal接口
    • Fal Get接口
  1. API Reference

Create Chat Completion

POST
https://api.shuyou.ai/v1/chat/completions

请求参数

Body 参数application/json

示例
{
    "model": "string",
    "messages": [
        {}
    ],
    "stream": true,
    "stream_options": {},
    "web_search_options": {},
    "reasoning_effort": "string",
    "reasoning": {
        "enabled": true,
        "effort": "string",
        "max_tokens": 0
    },
    "max_completion_tokens": 0,
    "temperature": 0,
    "top_p": 0,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "tools": [
        "string"
    ],
    "tool_choice": {},
    "response_format": {}
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://api.shuyou.ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "model": "string",
    "messages": [
        {}
    ],
    "stream": true,
    "stream_options": {},
    "web_search_options": {},
    "reasoning_effort": "string",
    "reasoning": {
        "enabled": true,
        "effort": "string",
        "max_tokens": 0
    },
    "max_completion_tokens": 0,
    "temperature": 0,
    "top_p": 0,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "tools": [
        "string"
    ],
    "tool_choice": {},
    "response_format": {}
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{"id":"e09fb692e2214cd1b25b1818109ac434","model":"google/gemini-3.1-flash-lite-preview","choices":[{"finish_reason":"stop","message":{"role":"assistant","content":"At its simplest, Artificial Intelligence (AI) is not magic; **it is advanced statistics.** \n\nRather than being \"programmed\" with explicit rules like traditional software (e.g., \"If the user clicks this button, do this\"), modern AI is **taught** by feeding it massive amounts of data so it can find patterns on its own.\n\nHere is a breakdown of how it works, from the basic concepts to the \"neural networks\" that power tools like ChatGPT.\n\n---\n\n### 1. The Three Pillars of AI\nFor AI to function, it needs three things:\n*   **Data:** This is the \"fuel.\" AI needs examples to learn from. To train an AI to recognize a cat, you show it millions of photos of cats.\n*   **Algorithms (Models):** These are the \"recipe.\" They are mathematical structures that tell the computer how to interpret the data.\n*   **Computing Power:** Training AI requires massive hardware (like GPUs) to perform billions of calculations per second to recognize those patterns.\n\n### 2. How it Learns (Machine Learning)\nIn traditional programming, a human writes a rulebook. In Machine Learning, the human gives the computer the goal, and the computer writes its own rulebook by analyzing data.\n\n**The \"Child Learning\" Analogy:**\nImagine teaching a child to recognize a dog. You don’t explain the geometry of a dog’s snout or the exact curvature of its ears. Instead, you point at a dog and say, \"That’s a dog.\" You point at a cat and say, \"That’s not a dog.\" Eventually, the child learns to identify a dog based on general patterns. \n\nAI does this same thing, but at a massive scale. It identifies which pixels in an image or which words in a sentence are statistically likely to be associated with a \"dog\" or a specific topic.\n\n### 3. Neural Networks: The \"Brain\"\nMost modern AI (like ChatGPT or image generators) uses something called a **Neural Network**. \n\n*   **Structure:** It is a digital mimic of biological neurons. It has layers: an **input layer** (where data enters), **hidden layers** (where the math happens), and an **output layer** (the result).\n*   **Weights and Biases:** Think of these as thousands of tiny \"knobs\" inside the network. When the AI makes a mistake during training, the system adjusts these knobs (a process called \"backpropagation\") to slightly change how it processes information. \n*   **Refinement:** After millions of iterations, the \"knobs\" are tuned so perfectly that the AI can accurately predict the answer almost every time.\n\n### 4. How Generative AI (like ChatGPT) Works\nYou might wonder how a chatbot can write essays or code. It isn't \"thinking\"; it is **predicting.**\n\nWhen you ask a question, the AI looks at the text you typed and calculates the statistical probability of what word should come next.\n*   *Prompt:* \"The cat sat on the...\"\n*   *AI Analysis:* It looks at billions of sentences it has \"read.\" It sees that after \"sat on the,\" the word \"mat\" is statistically very likely, \"floor\" is likely, but \"banana\" is statistically impossible. \n*   It picks the most likely next word, then repeats the process to pick the *next* word, and the next, until it creates a coherent response.\n\n### 5. Why AI Makes Mistakes (Hallucinations)\nBecause AI is based on **probability** rather than **facts**, it can sometimes confidently state something that is entirely false. This is called a \"hallucination.\"\n\nIf an AI is trained on data where people frequently talk about a fictional character as if they were real, the AI might incorporate that into its \"knowledge base.\" It doesn't know what is \"true\" in the real world; it only knows what is \"statistically likely\" based on the data it was fed.\n\n### Summary\n*   **Traditional Software:** A person writes the rules (If/Then).\n*   **AI:** The computer creates the rules by finding patterns in data.\n*   **Generative AI:** The computer predicts the next piece of information based on the patterns it learned during training.\n\nAI is essentially a **highly advanced pattern-matching machine.** It is incredibly efficient at finding connections in data that are too complex or numerous for humans to process, but it lacks consciousness, intent, or a true understanding of the world.","refusal":null,"reasoning":"**My Thought Process on Explaining AI**\n\nOkay, so I've been asked to explain how AI works. My first step, naturally, is to break down the request. I'm aiming for something accessible, not bogged down in jargon, but still technically accurate enough to be educational. The goal is to provide a clear, structured overview of the underlying concepts.\n\nNext, I need to brainstorm and structure my response. The core metaphor I'll use is comparing AI to how humans learn: it takes in input, recognizes patterns, and then makes predictions. The key components I need to cover are data, algorithms (or models, really), the training process, and how it performs inference. I need to distinguish between simple, rules-based AI and the modern stuff – Machine Learning and Deep Learning. I should probably also briefly address the \"black box\" nature of some AI, where we don't always know *why* a particular decision was made. Finally, I'll emphasize that AI is a tool, not magic.\n\nNow, into the actual drafting.\n\nI'll start with an engaging hook. Something like, \"AI isn't sentient. It's math.\" Then, the definition: software that mimics human cognitive functions.\n\nNext, the foundations: The \"Three Pillars.\" Data is the fuel. Algorithms/models are the recipes, the underlying math equations. And of course, computing power – think powerful hardware, GPUs, and TPUs, to keep it simple.\n\nThen the heart of it: how AI learns. I need to explain the difference between *Machine Learning* and traditional programming. Instead of writing \"If X, then Y,\" Machine Learning algorithms look at the data and find the rule themselves. I can use the analogy of teaching a child to recognize cats: you show them thousands of pictures and tell them \"that's a cat\".\n\nNow, I'll need a quick overview of *Neural Networks*. The inspiration is biological neurons, but really it's all math. Input -> Hidden Layers (processing) -> Output. I'll need to explain how the \"weights\" and \"biases\" are adjusted during training – the knobs that get tuned.\n\nI'll outline the process step-by-step: first, the *Training Phase* using massive datasets. Then, the *Inference Phase*, applying what it learned to new data.\n\nI'll also include a brief overview of the *Types of AI*: narrow AI (Siri, recommendation systems, chess) and generative AI.\n\nVery important: I need to add some *Caveats*. This is where I'll address bias (garbage in, garbage out), \"hallucinations\" (it predicts the most likely next word, not necessarily the *truth*), and the \"black box\" problem.\n\nTime to review. I need to check the tone – is it too academic? I'll probably need to use more relatable language, like the \"teaching a child\" analogy, and the \"filling in the blanks\" metaphor. I also need to ensure I don’t scare people away with the concept of Neural Networks; I'll emphasize it's just math. I'll make sure to explain Generative AI, and I might add a quick note about how it's all based on probability and \"next-token prediction.\"\n\nFinally, formatting: bold headers and bullet points for readability. And I'll end with a clear concluding summary statement.\n\n*(A quick mental note: I should clearly differentiate between \"Artificial General Intelligence\" (AGI), which is the science fiction version, and the \"Narrow AI\" that we actually have today.)*\n\nAnd there we have it. Ready to go.\n\n\n"},"index":0,"logprobs":null}],"usage":{"completion_tokens":1836,"prompt_tokens":5,"total_tokens":1841,"completion_tokens_details":{"reasoning_tokens":883},"trafficType":"ON_DEMAND","prompt_tokens_details":{"cached_tokens":0},"web_search":0,"tool_use":0},"object":"chat.completion","created":1773665788}
下一页
刷新缓存接口
Built with