콘텐츠로 이동
무료 가입
API 레퍼런스

Anthropic Messages API 사용

BetterToken의 Anthropic 호환 Messages API를 테스트하세요. x-api-key, anthropic-version, POST /v1/messages로 요청합니다.

POST /v1/messages

Claude Code, Anthropic SDK 및 Anthropic Messages API를 사용하는 applications에는 이 endpoint를 사용하세요.

Playground에서 테스트

오른쪽 Playground에서 x-api-key field에 API Key를 입력하고 anthropic-version은 2023-06-01로 유지한 후 사용할 수 있는 모델을 선택하여 request를 보내세요.

관련 endpoints

POST/v1/messages

인증

x-api-keystringheader필수

헤더

anthropic-versionstring기본값: 2023-06-01필수

The Anthropic API version header.

예제:"2023-06-01"

본문 application/json

modelstring필수

A model ID currently available in the model plaza. Check the model plaza for the latest options.

예제:"YOUR_MODEL_ID"
max_tokensinteger기본값: 1024필수

The maximum number of tokens to generate in the response.

필수 범위: x >= 1

예제:1024
messagesobject[]필수

Messages in Anthropic format. Each item should contain role and content.

Minimum array length: 1

Show child attributes
messages[].rolestring필수
예제:"user"
messages[].contentstring필수
예제:"Hello"

응답

200The Anthropic Messages result from the selected model.
400Invalid request format or parameters.
401The BetterToken API Key is missing or invalid.
402The account has insufficient credit or balance.
429The request exceeded a rate or concurrency limit, or the upstream service is busy.
500The gateway or upstream service returned an error.