請求頭:
Content-Type: 指定請求體的格式,此處為 application/json。
token: 用于身份驗證的API密鑰。將 "API_KEY" 替換為您的實際API密鑰。
請求體格式:
格式:JSON
參數:
mode: 指定故事生成的模式。在此例中,設置為 "Creative"(創意)。
text: 提供有關要生成故事的詳細信息的文本。這包括故事主題、背景設定、主要角色、情節細節、解決方式和主題。
word_count: 指定生成故事的期望字數,在此示例中設為 1200。
story_genre: 指定故事的類型。在此例中,設為 "Mystery"(神秘)。
認證:該API要求使用API密鑰(token)進行認證。
基于所提供的cURL命令,這是相應的文檔說明:
故事生成 API 文檔
端點:
POST https://www.capix.uz/v2/generate/story/
請求頭:
Content-Type: application/json
token: YOUR_API_KEY
請求體(JSON):
jsonCopy code{
"mode": "Creative",
"text": "Story Topic: A Time-Travel Adventure Setting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization. Main Characters: Alex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device. Eliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future. Plot Details: Discovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era. Meeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex's futuristic knowledge. Together, they explore the possibilities of time travel. A Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future. Race Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology. Resolution: The story concludes with a thrilling confrontation, and a decision that affects both characters' destinies. Themes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition.",
"word_count": 1200,
"story_genre": "Mystery"
}
請求參數:
mode: 指定故事生成的模式。
text: 關于故事的詳情,包括主題、背景、角色、情節、結局和主題。
word_count: 生成故事的目標字數。
story_genre: 故事的類型。
身份驗證:
此API要求使用API密鑰(令牌)進行身份驗證。
代碼示例:
curl -X POST "https://www.capix.uz/v2/generate/story/" \
-H "Content-Type: application/json" \
-H "token: API_KEY" \
-d '{
"mode": "Creative",
"text": "Story Topic: A Time-Travel Adventure Setting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization. Main Characters: Alex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device. Eliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future. Plot Details: Discovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era. Meeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex\'s futuristic knowledge. Together, they explore the possibilities of time travel. A Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future. Race Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology. Resolution: The story concludes with a thrilling confrontation, and a decision that affects both characters\' destinies. Themes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition.",
"word_count": 1200,
"story_genre": "Mystery"
}'
數據值:
字數:這是生成故事的最大字數限制。系統接受的最大字數為2000字。
寫作模式:可選的寫作模式有四種,分別是:標準(Standard)、復雜(Complex)、創意(Creative)和簡單(Simple)。
故事類型:故事類型可以是八種:科幻、神秘、奇幻、描述性