# 구조화된 의사결정 제출

**API:** Model API

**Endpoint:** `POST /api/v1/decisions`

비스트리밍 state/questions 요청이며, 답변은 Decisions 형식을 유지합니다.

## Base URL

- `https://openapi.felo.ai` — 프로덕션

## Authentication

- `FeloBearerAuth` (http bearer) — Felo API 키를 `Authorization: Bearer <key>` 형식으로 전송합니다.
- `FeloApiKey` (apiKey in header `X-API-Key`) — Felo API 키를 `X-API-Key: <key>` 형식으로 전송합니다.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `X-Felo-Channel` | header | no | string, default: "default" | 공개 채널 코드를 쉼표로 구분한 순서 있는 목록입니다. 이 헤더를 생략하면 default를 사용하며, default는 단독으로만 사용해야 합니다. 지갑 모드에서 default는 모델의 유효 공개 채널 순서를 역순으로 스캔하고, 게시되지 않았거나 사용할 수 없는 채널을 건너뛰며, 사용 가능한 첫 번째 채널의 공급자를 선택합니다. 동일한 업스트림 모델 ID와 서비스 티어를 가진 해당 공급자의 사용 가능한 엔드포인트도 포함합니다. 명시적 채널은 클라이언트가 지정한 순서로 검증되며, 첫 번째 채널의 공급자 그룹만 제출됩니다. 다른 공급자로의 자동 fallback은 없습니다. 레거시 공급자 헤더로는 채널 라우팅을 재정의할 수 없습니다. |

## Request body

Required: **yes**

### application/json

Schema: `DecisionsRequest` (`#/components/schemas/DecisionsRequest`)

```json
{
  "type": "object",
  "required": [
    "model",
    "state",
    "questions"
  ],
  "properties": {
    "model": {
      "type": "string"
    },
    "state": {},
    "questions": {
      "type": "object",
      "additionalProperties": {
        "type": "object"
      }
    },
    "stream": {
      "type": "boolean",
      "const": false
    },
    "service_tier": {
      "type": [
        "string",
        "null"
      ],
      "default": "default",
      "description": "현재는 default(표준)만 지원합니다. 생략, null, 별칭 및 지원되지 않는 문자열은 default로 대체되며, 다른 유형은 HTTP 400을 반환합니다. 구성된 채널과 가격은 변경되지 않습니다. 텍스트 API는 공급자의 표준 값을 전송하고, Decisions 및 생성 API는 업스트림 필드를 생략합니다."
    }
  },
  "additionalProperties": true,
  "description": "비스트리밍 Decisions이며, 질문 정의는 변경 없이 전달됩니다."
}
```

Example:

```json
{
  "model": "configured-decisions-model",
  "state": "A payout failed.",
  "questions": {
    "urgent": {
      "type": "noul",
      "instructions": "Is it urgent?",
      "criteria": {
        "true": "Urgent",
        "false": "No"
      }
    }
  }
}
```

## Responses

### 200 — 의사결정 답변

**application/json**

Schema: `DecisionsResponse` (`#/components/schemas/DecisionsResponse`)

### 400 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 401 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 402 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 403 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 429 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 502 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

### 503 — 요청이 거부되었거나 업스트림을 사용할 수 없습니다

**application/json**

Schema: `DecisionsErrorResponse` (`#/components/schemas/DecisionsErrorResponse`)

## Schema definitions

### DecisionsErrorResponse

`#/components/schemas/DecisionsErrorResponse`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

### DecisionsResponse

`#/components/schemas/DecisionsResponse`

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "answers": {
      "type": "object",
      "additionalProperties": true
    },
    "usage": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
```
