Loading...
    • 빌드
    • 관리
    • 모델 및 가격
    • 클라이언트 SDK
    • API 참조
    Search...
    ⌘K
    시작하기
    Claude 소개빠른 시작
    Claude로 구축하기
    기능 개요Messages API 사용중지 이유 처리
    모델 기능
    확장 사고적응형 사고노력빠른 모드 (베타: 리서치 프리뷰)구조화된 출력인용스트리밍 메시지일괄 처리검색 결과스트리밍 거부다국어 지원임베딩
    도구
    개요도구 사용 방법웹 검색 도구웹 가져오기 도구코드 실행 도구메모리 도구Bash 도구컴퓨터 사용 도구텍스트 편집기 도구
    도구 인프라
    도구 검색프로그래밍 방식 도구 호출세밀한 도구 스트리밍
    컨텍스트 관리
    컨텍스트 윈도우압축컨텍스트 편집프롬프트 캐싱토큰 계산
    파일 작업
    Files APIPDF 지원이미지 및 비전
    스킬
    개요빠른 시작모범 사례엔터프라이즈용 스킬API의 스킬
    MCP
    원격 MCP 서버MCP 커넥터
    프롬프트 엔지니어링
    개요프롬프트 모범 사례Console 프롬프트 도구
    테스트 및 평가
    성공 기준 정의 및 평가 구축Console의 평가 도구 사용지연 시간 줄이기
    가드레일 강화
    환각 줄이기출력 일관성 높이기탈옥 방지프롬프트 유출 줄이기
    리소스
    용어집
    릴리스 노트
    Claude Platform
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    에이전트에 작업 위임

    세션 시작

    에이전트를 실행하고 작업 실행을 시작하기 위한 세션을 생성합니다.

    Was this page helpful?

    • 볼트를 통한 MCP 인증

    세션은 환경 내에서 실행 중인 에이전트 인스턴스입니다. 각 세션은 에이전트와 환경(각각 별도로 생성됨)을 참조하며, 여러 상호작용에 걸쳐 대화 기록을 유지합니다.

    모든 Managed Agents API 요청에는 managed-agents-2026-04-01 베타 헤더가 필요합니다. SDK는 베타 헤더를 자동으로 설정합니다.

    세션 생성

    세션에는 agent ID와 environment ID가 필요합니다. 에이전트는 버전이 지정된 리소스입니다. agent ID를 문자열로 전달하면 최신 에이전트 버전으로 세션이 시작됩니다.

    session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
      -H "content-type: application/json" \
      -d @- <<EOF
    {
      "agent": "$AGENT_ID",
      "environment_id": "$ENVIRONMENT_ID"
    }
    EOF
    )
    SESSION_ID=$(jq -r '.id' <<< "$session")

    세션을 특정 에이전트 버전에 고정하려면 객체를 전달하세요. 이를 통해 실행할 버전을 정확히 제어하고 새 버전의 단계적 출시를 독립적으로 관리할 수 있습니다.

    에이전트는 모델, 시스템 프롬프트, 도구, MCP 서버를 포함하여 세션 내에서 Claude가 동작하는 방식을 정의합니다. 자세한 내용은 에이전트 설정을 참조하세요.

    볼트를 통한 MCP 인증

    에이전트가 인증이 필요한 MCP 도구를 사용하는 경우, 세션 생성 시 vault_ids를 전달하여 저장된 OAuth 자격 증명이 포함된 볼트를 참조하세요. Anthropic이 토큰 갱신을 대신 관리합니다. 볼트 생성 및 자격 증명 등록 방법은 볼트로 인증을 참조하세요.

    세션 시작

    세션을 생성하면 환경과 에이전트가 프로비저닝되지만 실제 작업은 시작되지 않습니다. 작업을 위임하려면 사용자 이벤트를 사용하여 세션에 이벤트를 전송하세요. 세션은 진행 상황을 추적하는 상태 머신으로 작동하며, 이벤트가 실제 실행을 구동합니다.

    에이전트의 응답을 스트리밍하고 도구 확인을 처리하는 방법은 이벤트 및 스트리밍을 참조하세요.

    세션 상태

    세션은 다음 상태를 거칩니다:

    상태설명
    idle에이전트가 사용자 메시지 또는 도구 확인을 포함한 입력을 기다리고 있습니다. 세션은 idle 상태로 시작됩니다.
    running에이전트가 활발하게 실행 중입니다
    rescheduling일시적인 오류가 발생하여 자동으로 재시도 중입니다
    terminated복구 불가능한 오류로 인해 세션이 종료되었습니다

    기타 세션 작업

    세션 조회

    세션 목록 조회

    세션 보관

    세션을 보관하면 기록을 보존하면서 새 이벤트가 전송되는 것을 방지합니다:

    세션 삭제

    세션을 삭제하면 해당 레코드, 이벤트 및 연결된 컨테이너가 영구적으로 제거됩니다. running 상태의 세션은 삭제할 수 없습니다. 즉시 삭제해야 하는 경우 인터럽트 이벤트를 전송하세요.

    파일, 메모리 저장소, 환경 및 에이전트는 독립적인 리소스이며 세션 삭제의 영향을 받지 않습니다.

    pinned_session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
      -H "content-type: application/json" \
      -d @- <<EOF
    {
      "agent": {"type": "agent", "id": "$AGENT_ID", "version": 1},
      "environment_id": "$ENVIRONMENT_ID"
    }
    EOF
    )
    PINNED_SESSION_ID=$(jq -r '.id' <<< "$pinned_session")
    vault_session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
      -H "content-type: application/json" \
      -d @- <<EOF
    {
      "agent": "$AGENT_ID",
      "environment_id": "$ENVIRONMENT_ID",
      "vault_ids": ["$VAULT_ID"]
    }
    EOF
    )
    VAULT_SESSION_ID=$(jq -r '.id' <<< "$vault_session")
    curl -fsSL "https://api.anthropic.com/v1/sessions/$SESSION_ID/events" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
      -H "content-type: application/json" \
      -d @- <<'EOF'
    {
      "events": [
        {
          "type": "user.message",
          "content": [{"type": "text", "text": "List the files in the working directory."}]
        }
      ]
    }
    EOF
    retrieved=$(curl -fsSL "https://api.anthropic.com/v1/sessions/$SESSION_ID" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01")
    echo "Status: $(jq -r '.status' <<< "$retrieved")"
    curl -fsSL https://api.anthropic.com/v1/sessions \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01" \
      | jq -r '.data[] | "\(.id): \(.status)"'
    curl -fsSL -X POST "https://api.anthropic.com/v1/sessions/$SESSION_ID/archive" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01"
    curl -fsSL -X DELETE "https://api.anthropic.com/v1/sessions/$SESSION_ID" \
      -H "x-api-key: $ANTHROPIC_API_KEY" \
      -H "anthropic-version: 2023-06-01" \
      -H "anthropic-beta: managed-agents-2026-04-01"