AgnesモデルAPI呼び出しガイド
サードパーティツール不要——HTTPで直接Agnes動画モデルを呼び出す、完全なPythonコード例付き
前提条件
APIを呼び出す前に必要なもの:
- 有効なAgnes API Key(Agnes Cloud Platformから取得)
- 基本的なHTTPリクエストの知識(Pythonでの例を示しますが、任意の言語で動作します)
APIエンドポイント
POST
https://api.agnes-ai.com/v1/video/generate
認証方法
すべてのAPIリクエストはヘッダーにBearer Token認証を含める必要があります:
// Authorization header
Authorization: Bearer YOUR_API_KEY
リクエストボディ
POSTリクエストを送信し、JSONボディに以下のパラメータを含めます:
{
"prompt": "A cat walking through a neon-lit Tokyo alley",
"duration": 5,
"resolution": "1080p",
"style": "cinematic",
"narration": true,
"narration_lang": "en",
"subtitles": true
}パラメータリファレンス
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
| prompt | string | はい | 動画説明テキスト(英語または中国語)、推奨20〜200文字 |
| duration | number | いいえ | 動画の長さ(秒)、デフォルト5、範囲3〜30 |
| resolution | string | いいえ | 解像度:720p / 1080p、デフォルト1080p |
| style | string | いいえ | 動画スタイル:cinematic / anime / realistic / abstract |
| narration | boolean | いいえ | AIナレーションを生成するかどうか、デフォルトfalse |
| narration_lang | string | いいえ | ナレーション言語:zh / en / ja / ko など、narration=trueが必要 |
| subtitles | boolean | いいえ | 字幕を生成するかどうか、デフォルトfalse |
完全なPython例
タスクの送信、ステータスのポーリング、動画の取得を行う完全なPython例:
import requests
API_KEY = "your_api_key_here"
url = "https://api.agnes-ai.com/v1/video/generate"
headers = {"Authorization": f"Bearer {API_KEY}"}
payload = {
"prompt": "A drone shot of a mountain lake at sunrise",
"duration": 8,
"resolution": "1080p",
}
resp = requests.post(url, json=payload, headers=headers)
task = resp.json()
print(f"Task ID: {task['task_id']}")
# Poll for result
status = requests.get(
f"https://api.agnes-ai.com/v1/video/status/{task['task_id']}",
headers=headers
)
print(status.json()['video_url'] if status.json().get('video_url')
else "Still generating...")コードを書きたくないですか?
上記のすべてのAPI呼び出し——認証、パラメータ構築、ステータスポーリング、エラーリトライ——はAgnes Video Generatorがすでに処理しています。ブラウザを開いてアイデアを入力し、ワンクリックで動画を生成するだけです。Agnes動画モデルを使用する最も簡単な方法です。
Agnes Video Generatorをオンラインで試す →関連ページ
Agnes AI Video Model Overview — Capabilities, Versions & Access | Free AI Video Guide
A complete overview of the Agnes AI video model: core capabilities, version differences, and access methods. From text-to-video to image-to-video, master the full picture.
Agnes Model Prompt Engineering — 5 Tips for Better Video Prompts | Free AI Video Guide
Master prompt engineering for the Agnes video model. From camera language to temporal description — 5 core principles with good/bad examples. Make AI understand your vision precisely.