Responses API Beta は、「シンプルな文字列入力」と「構造化メッセージ配列」の 2 つの入力方法をサポートしています。Documentation Index
Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
Use this file to discover all available pages before exploring further.
シンプルな文字列入力
API を最も簡単に使う方法は、文字列を直接渡すことです:curl -X POST https://aihubmix.com/v1/responses \
-H "Authorization: Bearer YOUR_AIHUBMIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"input": "What is the meaning of life?",
"max_output_tokens": 5000
}'
構造化メッセージ入力
より複雑な会話の場合は、メッセージ配列形式を使用できます:curl -X POST https://aihubmix.com/v1/responses \
-H "Authorization: Bearer YOUR_AIHUBMIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"input": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "Plan a week-long trip to the US for me."
}
]
}
],
"max_output_tokens": 5000
}'
レスポンス形式
API は生成されたコンテンツを含む構造化レスポンスを返します:{
"id": "resp_06785a42ff90c6",
"object": "response",
"created_at": 1773136544,
"status": "completed",
"background": false,
"completed_at": 1773136550,
"content_filters": null,
"error": null,
"frequency_penalty": 0.0,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": 9000,
"max_tool_calls": null,
"model": "gpt-54",
"output": [
{
"id": "rs_06785a42ff90c6d20069afeaa0731c81979150247a7ee80c8a",
"type": "reasoning",
"summary": []
},
{
"id": "msg_06785a42ff90c6d20069afeaa22f3c819781184c050374974d",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "There is no single, universally agreed-upon “answer” to the question “What is the meaning of life?”—it depends on your background, beliefs and the lenses through which you look. Here are a few ways people have approached it:\n\n1. Religious and spiritual perspectives \n • In many theistic traditions, life’s meaning is found in a relationship with the divine—loving and serving God (or gods), living according to sacred teachings, and preparing for an afterlife or spiritual growth. \n • In Eastern spiritualities (Buddhism, Hinduism), life can be about liberating yourself from suffering and ignorance (nirvana or moksha), often through compassion, selflessness and meditation.\n\n2. Philosophical viewpoints \n • Existentialism (Sartre, Camus) argues that life has no inherent meaning—each of us must create our own through our choices, actions and commitments. \n • Nihilism holds that life is ultimately meaningless, but some see this “freedom from pre-existing purpose” as an opportunity to build authentic values for oneself. \n • Aristotelian ethics looks for eudaimonia (“flourishing” or “well-being”) achieved by cultivating virtues—courage, wisdom, justice, friendship—and living in balance.\n\n3. Scientific and naturalistic outlooks \n • From a biological standpoint, life’s “purpose” is to survive and reproduce, passing on genes to the next generation. \n �� Many scientists and secular thinkers add that we can create our own meaning by pursuing knowledge, understanding the universe, and using our creativity to improve the human condition.\n\n4. Psychological and humanistic approaches \n • Viktor Frankl (logotherapy) proposed that finding purpose—even in suffering—is crucial to mental health. Meaning can be discovered through work you care about, relationships you value, and the attitude you take toward unavoidable suffering. \n • Positive psychology emphasizes factors like relationships, achievement, personal growth and contribution to something larger than yourself as sources of fulfilment.\n\n5. A personal, evolving journey \n • Ultimately, most agree that “the meaning of life” is something you discover or construct for yourself. It may come from: \n – Deep relationships (family, friends, community) \n – Creative expression (art, music, writing, invention) \n – Service to others (volunteering, activism, caregiving) \n – Pursuit of knowledge (science, philosophy, exploration) \n – Personal growth (learning, overcoming challenges, self-reflection)\n\nHow to explore your own answer: \n• Reflect on your core values and what gives you genuine joy. \n• Notice what activities make you lose track of time or give you a sense of flow. \n• Engage in conversations with people of different beliefs and life experiences. \n• Experiment with new pursuits—volunteering, creative hobbies, study, travel. \n• Be patient: your sense of purpose may shift as you grow, face new challenges or learn more about the world and yourself.\n\nIn the end, the question “What is the meaning of life?” invites you not to find a one-size-fits-all answer, but to embark on a lifelong journey of discovery—to shape, live out and continually refine your own answer."
}
],
"role": "assistant"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"previous_response_id": null,
"prompt_cache_key": null,
"prompt_cache_retention": null,
"reasoning": {
"effort": "medium",
"summary": null
},
"safety_identifier": null,
"service_tier": "default",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1.0,
"truncation": "disabled",
"usage": {
"input_tokens": 13,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 935,
"output_tokens_details": {
"reasoning_tokens": 256
},
"total_tokens": 948
},
"user": null,
"metadata": {}
}
ストリーミングレスポンス
リアルタイムのコンテンツ生成のためにストリーミング出力を有効にできます:curl -X POST https://aihubmix.com/v1/responses \
-H "Authorization: Bearer YOUR_AIHUBMIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"input": "What is the meaning of life?",
"max_output_tokens": 9000,
"stream": true
}'
共通パラメータ
| パラメータ | タイプ | 説明 |
|---|---|---|
| model | string | 必須。使用するモデル。例:gpt-5.4 |
| input | string または array | 必須。入力テキストまたはメッセージ配列 |
| stream | boolean | ストリーミングレスポンスを有効にするかどうか(デフォルト false) |
| max_output_tokens | integer | 出力トークンの最大数 |
| temperature | number | サンプリング温度。範囲 0 〜 2 |
| top_p | number | サンプリングパラメータ。範囲 0 〜 1 |
最終更新日:2026-06-01