Anthropic Claude API

Delphi 애플리케이션에 Anthropic Claude AI 모델을 통합하여 고급 채팅, 분석, 콘텐츠 생성, 비전, 도구 사용 기능을 활용해 보세요.

TsgcHTTP_API_Anthropic

Anthropic Messages API를 위한 타입이 지정된 Delphi/C++Builder 클라이언트예요 — 스트리밍, 도구 사용, 비전, 확장된 사고, 프롬프트 캐싱, 파일, Claude에서의 MCP를 지원해요.

컴포넌트 클래스

TsgcHTTP_API_Anthropic

프로토콜

Anthropic Messages API

플랫폼

Windows, macOS, Linux, iOS, Android

에디션

Standard / Professional / Enterprise

API 키를 설정하고, 요청을 구성한 후, 답변을 스트리밍하세요

AnthropicOptions에 ApiKey를 설정한 다음, 타입이 지정된 요청에는 CreateMessage를 호출하거나 _CreateMessage / _CreateMessageStream JSON 문자열 단축키를 사용하세요.

uses
  sgcHTTP_API_Anthropic;

var
  Anthropic: TsgcHTTP_API_Anthropic;
begin
  Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
  Anthropic.AnthropicOptions.ApiKey := 'sk-ant-...';

  // One-shot synchronous call
  Memo1.Text := Anthropic._CreateMessage(
    'claude-sonnet-4-5-20250929',
    'Explain WebSockets in two sentences.',
    1024);

  // Streaming - OnHTTPAPISSE fires per delta
  Anthropic.OnHTTPAPISSE := HandleSSE;
  Anthropic._CreateMessageStream(
    'claude-sonnet-4-5-20250929',
    'Summarise RFC 6455',
    1024);
end;

procedure TForm1.HandleSSE(Sender: TObject;
  const aEvent, aData: string;
  var Cancel: Boolean);
begin
  Memo1.Lines.Add(aEvent + ': ' + aData);
end;
// uses: sgcHTTP_API_Anthropic
TsgcHTTP_API_Anthropic *Anthropic = new TsgcHTTP_API_Anthropic(this);
Anthropic->AnthropicOptions->ApiKey = "sk-ant-...";

UnicodeString reply = Anthropic->_CreateMessage(
  "claude-sonnet-4-5-20250929",
  "Explain WebSockets in two sentences.",
  1024);

Memo1->Lines->Add(reply);

내부 구성

공급업체가 공개한 모든 엔드포인트를 포함하는 Anthropic Messages API 표면의 타입이 지정된 미러예요.

메시지

CreateMessage는 타입이 지정된 TsgcAnthropicClass_Request_Messages를 받아 파싱된 응답을 반환해요. _CreateMessage, _CreateMessageWithSystem, _CreateMessageStream, _CreateMessageWithThinking은 JSON 문자열 단축키예요.

도구 사용 및 구조화된 출력

Claude에 함수 호출 도구를 노출하려면 TsgcAnthropicClass_Request_Tool 항목을 구성하세요. _CreateMessageJSON은 구조화된 출력에 인라인 JSON 스키마를 적용해요.

비전 및 문서

이미지와 PDF를 콘텐츠 블록으로 첨부하세요 — _CreateVisionMessage_CreateDocumentMessage가 base64 프레이밍과 document 콘텐츠 타입을 처리해요.

확장된 사고

요청에서 thinking을 활성화해 Claude의 확장된 추론 모드를 켜세요. _CreateMessageWithThinking_CreateMessageWithAdaptiveThinking은 예산을 설정하고 사고 블록을 표시해요.

프롬프트 캐싱

반복 프롬프트의 지연 시간과 비용을 줄이려면 시스템 또는 사용자 블록에 cache_control: {type: ephemeral}을 추가하세요. 적중/미적중 카운터는 응답 사용 블록에 반환돼요.

파일, 배치, 웹 검색, MCP

Files API, 비동기 메시지 배치, 서버 측 WebSearch 도구, Claude를 MCP 호스트로 사용하는 엔드포인트 모두 동일한 컴포넌트에서 제공돼요.

사양 및 참조 문서

이 컴포넌트가 구현하는 API의 공식 참조 출처예요.

문서 및 데모

컴포넌트 참조 문서로 바로 이동하고, 바로 실행 가능한 데모 프로젝트를 받고, 체험판을 다운로드해 보세요.

온라인 도움말 — TsgcHTTP_API_Anthropic 이 컴포넌트의 전체 속성, 메서드, 이벤트 참조 문서.
데모 프로젝트 — Demos\15.AI\Anthropic 바로 실행 가능한 예제 프로젝트예요. sgcWebSockets 패키지에 포함되어 있어요 — 아래에서 체험판을 다운로드하세요.
기술 문서 (PDF) 기능, 빠른 시작, Delphi 및 C++ Builder 코드 샘플 및 1차 출처 참고 — 이 컴포넌트 전용.
사용자 설명서 (PDF) 라이브러리의 모든 컴포넌트를 다루는 종합 설명서.

Claude AI를 통합할 준비가 됐나요?

무료 체험판을 다운로드하고, Delphi 애플리케이션에 Anthropic Claude를 추가해 보세요.