> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI 추론 예시

> OpenAI 스타일 통합을 위한 추론 모델 예입니다.

## 권장 엔드포인트

* [오픈AI /v1/responses](/ko/api-reference/endpoints/openai/responses)

## 최소한의 요청

```json theme={null}
{
  "model": "o4-mini",
  "input": "Compare three cache architectures and recommend one.",
  "reasoning": {
    "effort": "medium"
  },
  "max_output_tokens": 1200
}
```

## cURL 예

```bash theme={null}
curl https://maas.apigo.ai/v1/responses \
  -H "Authorization: Bearer $YOUR API KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "o4-mini",
    "input": "Compare three cache architectures and recommend one.",
    "reasoning": {
      "effort": "medium"
    },
    "max_output_tokens": 1200
  }'
```

## 파이썬 예제

```python theme={null}
from openai import OpenAI

client = OpenAI(
    base_url="https://maas.apigo.ai/v1",
    api_key="<YOUR API KEY>",
)

response = client.responses.create(
    model="o4-mini",
    input="Compare three cache architectures and recommend one.",
    reasoning={"effort": "medium"},
    max_output_tokens=1200,
)

print(response.output_text)
```

## Node.js 예

```js theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://maas.apigo.ai/v1",
  apiKey: process.env.YOUR API KEY,
});

const response = await client.responses.create({
  model: "o4-mini",
  input: "Compare three cache architectures and recommend one.",
  reasoning: { effort: "medium" },
  max_output_tokens: 1200,
});

console.log(response.output_text);
```

## 모범 사례

* 비용 및 대기 시간을 위해 `reasoning.effort`를 명시적으로 제어합니다.
* 단순한 사고방식보다는 의사결정 준비가 완료된 결과물을 요청하세요.
* 일반 채팅 트래픽과 별도로 지연 시간 및 토큰 비용을 추적합니다.
