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

# 실행 요청

> 조직의 프롬프트들을 지정한 모델로 단발성 실행하는 Run을 생성합니다. 실행 대상은 promptIDs(개별 프롬프트 지정) 또는 promptSetID(프롬프트 세트 전체) 중 정확히 하나로 지정합니다. 진행 상태는 반환된 runID로 Run 상태 조회에서 확인합니다.

전체 흐름(프롬프트 준비 → 제출 → 폴링 → 답변 수집)과 폴링 루프 코드는 [프롬프트 실행하기](/guides/submitting-runs) 가이드를 참고하세요.

## 자주 묻는 질문

**제출 후 결과는 어디서 받나요?**
반환된 `runID`로 [실행 상태 조회](/api-reference/runs/get-run-status)를 폴링하고, `FINISHED`가 되면 [답변 목록](/api-reference/answers/list-answers)을 `runID` 필터로 조회합니다.


## OpenAPI

````yaml POST /v1beta/platform/runs
openapi: 3.1.0
info:
  description: >-
    외부 파트너용 플랫폼 API. 조직 API 키 기반 인증을 사용합니다.

    ### 공통 요청 제한

    - 요청 body 크기는 최대 2MiB이며, 초과 시 413과 함께 `COMMON_REQUEST_BODY_TOO_LARGE` 코드를
    반환합니다.

    - 배열 파라미터와 문자열 필드에는 엔드포인트별 개수·길이 상한이 있습니다. 상한은 각 필드/파라미터 설명에 명시되어 있으며, 위반 시
    400과 함께 `COMMON_VALIDATION` 코드를 반환합니다.

    - 검증 실패 시 `details` 배열에 위반 필드와 사유가 담깁니다. 예:
    `{"code":"COMMON_VALIDATION","message":"데이터 검증에
    실패했습니다","details":["keywords: 최대 100개까지 입력할 수 있습니다"]}`

    - `message`와 `details`는 Accept-Language 헤더에 따라 한국어(ko) 또는 영어(en)로 제공됩니다.
  title: Platform API
  version: '1.0'
servers:
  - url: https://dev-platform-api.trychainshift.ai/api
security: []
tags:
  - description: API 키가 귀속되는 최상위 계정 단위입니다. 조직의 기본 정보를 조회합니다.
    name: Organization
  - description: AI 서비스에서 노출을 모니터링하는 대상 브랜드입니다. 브랜드 등록·조회·수정·삭제를 제공합니다.
    name: Brand
  - description: >-
      브랜드와 시장을 분석하기 위한 키워드 인텔리전스입니다. 구글·네이버 검색 지표, 연관·자동완성 키워드 조회와 사이트 URL 기반
      키워드 분석을 제공합니다.
    name: Keyword
  - description: 프롬프트를 목적별로 묶는 그룹입니다. 프롬프트 세트 생성·조회·수정·삭제를 제공합니다.
    name: PromptSet
  - description: AI 서비스에 질의하는 문장 단위입니다. 프롬프트 생성·조회·수정·삭제와 대량 생성을 제공합니다.
    name: Prompt
  - description: 실행(Run)에 사용하는 AI 서비스 모델입니다. 지원 모델 목록을 조회합니다.
    name: Model
  - description: Run 제출에 사용하는 실행 지역입니다. 지원 리전 목록을 조회합니다.
    name: Region
  - description: 프롬프트를 AI 서비스에 실제로 실행하는 작업 단위입니다. Run 제출과 진행 상태·목록 조회를 제공합니다.
    name: Run
  - description: 실행으로 수집된 AI 서비스의 응답입니다. 인용 출처·검색 쿼리를 포함한 답변을 조회합니다.
    name: Answer
  - description: 답변에 인용된 출처를 도메인·URL 단위로 집계한 지표입니다. 인용 요약, 도메인별·URL별 인용 집계를 조회합니다.
    name: SourceStatistics
  - description: 답변 본문의 토큰(Kiwi 명사)을 집계한 지표입니다. 많이 나온 토큰 랭킹과 특정 단어의 근접 토큰을 조회합니다.
    name: AnswerStatistics
  - description: AI가 답변 생성 시 실제로 던진 검색 쿼리(팬아웃)를 집계한 지표입니다. 검색 쿼리별 등장 횟수 랭킹을 조회합니다.
    name: FanoutStatistics
  - description: 텍스트에서 고유명사를 식별하는 부가 기능입니다. 고유명사 추출을 제공합니다.
    name: ProperNoun
  - description: 조직 크레딧 잔액 및 플랫폼 API 과금 정보입니다. 현재 크레딧 잔액을 조회합니다.
    name: Credit
externalDocs:
  description: ''
  url: ''
paths:
  /v1beta/platform/runs:
    post:
      tags:
        - Run
      summary: Run 제출
      description: >-
        조직의 프롬프트들을 지정한 모델로 단발성 실행하는 Run을 생성합니다. 실행 대상은 promptIDs(개별 프롬프트 지정) 또는
        promptSetID(프롬프트 세트 전체) 중 정확히 하나로 지정합니다. 진행 상태는 반환된 runID로 Run 상태 조회에서
        확인합니다.
      operationId: submitPlatformRun
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/domain.SubmitRunRequest'
        description: Run 제출 요청
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.SubmitRunResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: >-
            잘못된 요청: 검증 실패 (모델 누락·개수 초과, promptIDs/promptSetID 미지정·중복
            지정(RUN_PROMPT_TARGET_REQUIRED), 빈 프롬프트 세트(PROMPT_SET_EMPTY), 미지원 모델,
            모델이 지원하지 않는 지역(REGION_NOT_SUPPORTED_FOR_MODEL), 총 실행 수
            초과(RUN_TOO_MANY_TASKS) 등)
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: '인증 실패: API 키가 유효하지 않습니다'
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: '크레딧 부족 (INSUFFICIENT_CREDITS): 실행 규모(모델×프롬프트×반복)에 필요한 크레딧이 잔액보다 큽니다'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: >-
            프롬프트(PROMPT_NOT_FOUND) 또는 프롬프트 세트(PROMPT_SET_NOT_FOUND)를 찾을 수 없습니다
            (타 조직 소유 포함)
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: 요청 한도 초과 (PLATFORM_RATE_LIMIT_EXCEEDED, Retry-After 헤더 참조)
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain.Error'
          description: 서버 내부 오류
      security:
        - OrgAPIKeyAuth: []
components:
  schemas:
    domain.SubmitRunRequest:
      properties:
        models:
          description: >-
            실행 모델 목록 (1~20개, 중복은 1회로 처리, 예: CHATGPT). 목록에 없는 값은 400 으로 거부된다 —
            GET /models 로 조회 가능
          items:
            $ref: '#/components/schemas/domain.RunModel'
          maxItems: 20
          minItems: 1
          type: array
          uniqueItems: false
        promptIDs:
          description: 실행할 프롬프트(question) ID 목록 (1~500개, 중복은 1회로 처리)
          items:
            type: string
          maxItems: 500
          minItems: 1
          type: array
          uniqueItems: false
        promptSetID:
          description: >-
            실행할 프롬프트 세트 ID — 세트 소속 프롬프트 전체를 실행한다. promptIDs 와 정확히 하나만 지정. 세트
            프롬프트 수에 500개 제한은 없으며 총 실행 수 상한(10,000)만 적용
          type: string
        region:
          description: >-
            실행 지역(ISO 3166-1 alpha-2, 예: KR·US·JP). 생략 시 KR. 지원하지 않는 코드는 400.
            모델마다 지원 지역이 다를 수 있으며(GET /regions?model= 로 확인), 지원하지 않는 조합은 400
          type: string
        repeatCount:
          description: >-
            각 프롬프트(question)별 반복 실행 횟수 (기본 1, 최대 100). 총 실행 수(프롬프트 수 × 모델 수 × 반복
            횟수)가 10,000을 초과하면 400 (RUN_TOO_MANY_TASKS)
          maximum: 100
          minimum: 1
          type: integer
      required:
        - models
        - promptIDs
      type: object
    domain.SubmitRunResponse:
      properties:
        runID:
          description: 이번 제출의 실행 단위(TaskGenerationRun) ID. 외부엔 Run ID 로 노출한다.
          type: string
      type: object
    domain.Error:
      properties:
        code:
          type: string
        details: {}
      type: object
    domain.RunModel:
      enum:
        - CHATGPT
        - GOOGLE_OVERVIEW
        - GOOGLE_AI
        - PERPLEXITY
        - GEMINI
        - NAVER_AI_BRIEFING
        - NAVER_AI_TAB
        - CLAUDE
      type: string
      x-enum-varnames:
        - RunModelChatGPT
        - RunModelGoogleOverview
        - RunModelGoogleAI
        - RunModelPerplexity
        - RunModelGemini
        - RunModelNaverAIBriefing
        - RunModelNaverAITab
        - RunModelClaude
  securitySchemes:
    OrgAPIKeyAuth:
      description: '"조직 API 키를 입력하세요. 예: ''cs_live_xxxx'' 또는 ''cs_test_xxxx''"'
      in: header
      name: API-Key
      type: apiKey

````