- Text input: 텍스트 입력
- Image input: 이미지 입력
- Streaming: 스트리밍
- Web search: 웹 검색
- Reasoning: 추론 깊이 제어. 4단계 지원 (minimal / low / medium / high). 참고로 minimal 은 gpt-5 시리즈에서만 사용할 수 있습니다.
- Verbosity: 출력 길이. gpt-5 는 3단계 지원 (low / medium / high)
- Functions: 함수
- image_generation tool usage: 이미지 그리기 및 생성은
gpt-image-1로 청구됩니다. - Code Interpreter: 모델이 Python을 작성하고 실행하여 문제를 해결할 수 있도록 합니다
- Remote MCP: 원격 MCP 서버 호출
- Computer Use: 컴퓨터 사용
사용법 (Python 호출):
공식 OpenAI 호출 방법과 동일하며, 전달을 위해api_key와 base_url만 교체하면 됩니다.
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # AiHubMix에서 생성한 키로 교체하세요
base_url="https://aihubmix.com/v1"
)
"summary": "auto"
from openai import OpenAI
client = OpenAI(
api_key="sk-***", # 將其替換為你在 AIHubMix 後台產生的金鑰
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-5", # gpt-5, gpt-5-chat-latest, gpt-5-mini, gpt-5-nano
input="Why does tarot reading work, what are the underlying principles, and what transferable methods are there? Output format: Markdown", # GPT-5 預設不以 Markdown 格式輸出,因此需要明確指定。
reasoning={
"effort": "minimal" # 推理深度——控制模型在產生回覆前會生成多少推理 token。可用值為 "minimal"、"low"、"medium" 或 "high"。預設為 "medium"。
},
text={
"verbosity": "low" # 輸出長度——冗長度決定會生成多少輸出 token。可用值為 "low"、"medium" 或 "high"。GPT-5 之前的模型預設為 "medium" 冗長度。
},
stream=True
)
for event in response:
print(event)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-4o-mini", # codex-mini-latest 사용 가능
input="Tell me a three sentence bedtime story about a unicorn."
)
print(response)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-4o-mini", # codex-mini-latest 사용 가능
input=[
{
"role": "user",
"content": [
{ "type": "input_text", "text": "what is in this image?" },
{
"type": "input_image",
"image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
]
}
]
)
print(response)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-4o-mini", # codex-mini-latest 사용 가능
instructions="You are a helpful assistant.",
input="Hello!",
stream=True
)
for event in response:
print(event)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-4o-mini",
tools=[{ "type": "web_search_preview" }],
input="What was a positive news story from today?",
)
print(response)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1/"
)
response = client.responses.create(
model="o4-mini", # codex-mini-latest, o4-mini, o3-mini, o3, o1
input="How much wood would a woodchuck chuck?",
reasoning={
"effort": "medium", # low, medium, high
"summary": "auto", # 추론 요약
}
)
print(response)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
tools = [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location", "unit"],
}
}
]
response = client.responses.create(
model="gpt-4o-mini", # codex-mini-latest 사용 가능
tools=tools,
input="What is the weather like in Boston today?",
tool_choice="auto"
)
print(response)
from openai import OpenAI
import base64
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
response = client.responses.create(
model="gpt-4.1-mini",
input="Generate an image of gray tabby cat hugging an otter with an orange scarf",
tools=[{"type": "image_generation"}],
)
# 이미지를 파일로 저장
image_data = [
output.result
for output in response.output
if output.type == "image_generation_call"
]
if image_data:
image_base64 = image_data[0]
with open("cat_and_otter.png", "wb") as f:
f.write(base64.b64decode(image_base64))
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
instructions = """
You are a personal math tutor. When asked a math question,
write and run code using the python tool to answer the question.
"""
resp = client.responses.create(
model="gpt-4.1",
tools=[
{
"type": "code_interpreter",
"container": {"type": "auto"}
}
],
instructions=instructions,
input="I need to solve the equation 3x + 11 = 14. Can you help me?",
)
print(resp.output)
from openai import OpenAI
client = OpenAI(
api_key="AIHUBMIX_API_KEY", # 당신의 키 "sk-***"
base_url="https://aihubmix.com/v1"
)
resp = client.responses.create(
model="gpt-4.1",
tools=[{
"type": "mcp",
"server_label": "deepwiki",
"server_url": "https://mcp.deepwiki.com/mcp",
"require_approval": "never",
"allowed_tools": ["ask_question"],
}],
input="What transport protocols does the 2025-03-26 version of the MCP spec (modelcontextprotocol/modelcontextprotocol) support?",
)
print(resp.output_text)
- 최신
codex-mini-latest는 검색을 지원하지 않습니다. - Computer use 기능은 Playwright와의 통합이 필요합니다. 공식 저장소를 참조하는 것을 권장합니다.
- 사용 사례가 복잡하여 호출이 어려움
- 많은 스크린샷을 찍어 시간이 오래 걸리고 종종 불안정함
- CAPTCHA나 Cloudflare 인간 검증을 유발하여 무한 루프에 빠질 가능성
마지막 업데이트: 2026-06-01