TsgcHTTP_API_Anthropic › Properties › AnthropicOptions
API 키, HTTP 옵션, 로깅, 재시도 및 anthropic-version 헤더를 포함하여 Anthropic API에 대한 연결 설정을 보관합니다.
property AnthropicOptions: TsgcHTTPAnthropic_Options read FAnthropicOptions
write SetAnthropicOptions;
—
AnthropicOptions는 https://api.anthropic.com/v1로 전송되는 모든 요청에서 사용하는 하위 속성을 노출합니다: ApiKey는 x-api-key 헤더로 전송되고, HttpOptions는 프록시/user-agent/연결 설정을 제어하며, LogOptions는 요청/응답 추적을 활성화하고, RetryOptions는 일시적 장애 시 자동 재시도를 구성합니다. 필수 anthropic-version 헤더(예: 2023-06-01)도 여기에서 관리됩니다. 디자인 타임 또는 시작 시 이 속성을 한 번 구성하면 이후의 모든 API 호출이 동일한 자격 증명과 정책을 재사용합니다.
oAPI := TsgcHTTP_API_Anthropic.Create(nil);
oAPI.AnthropicOptions.ApiKey := 'sk-ant-...';
oAPI.AnthropicOptions.AnthropicVersion := '2023-06-01';
oAPI.AnthropicOptions.HttpOptions.UserAgent := 'MyApp/1.0';
oAPI.AnthropicOptions.RetryOptions.Enabled := True;