Claude Platform Docs

PHP API reference

Criar uma mensagem
$client->messages->create(int maxTokens, list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?MessageCreateParamsContainer container, ?string inferenceGeo, ?Metadata metadata, ?OutputConfig outputConfig, ?ServiceTier serviceTier, ?list<string> stopSequences, ?System system, ?float temperature, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<ToolUnion> tools, ?int topK, ?float topP, ?string userProfileID, ?string workspaceID): Message
POST/v1/messages

Envie uma lista estruturada de mensagens de entrada com conteúdo de texto e/ou imagem, e o modelo gerará a próxima mensagem na conversa.

Contar tokens em uma mensagem
$client->messages->countTokens(list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?OutputConfig outputConfig, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<MessageCountTokensTool> tools, ?string userProfileID, ?string workspaceID): MessageTokensCount
POST/v1/messages/count_tokens

Conte o número de tokens em uma mensagem.

Listar modelos
$client->models->list(?string afterID, ?string beforeID, ?int limit, ?list<AnthropicBeta> betas, ?string workspaceID): Page<ModelInfo>
GET/v1/models

Liste os modelos disponíveis.

Obter um modelo
$client->models->retrieve(string modelID, ?list<AnthropicBeta> betas, ?string workspaceID): ModelInfo
GET/v1/models/{model_id}

Obtenha um modelo específico.

Fazer upload de arquivo
$client->files->upload(string file, ?int expiresInSeconds, ?string workspaceID): FileMetadata
POST/v1/files
Listar arquivos
$client->files->list(?list<string> ids, ?int limit, ?string page, ?string workspaceID): PageCursor<FileMetadata>
GET/v1/files
Baixar arquivo
$client->files->download(string fileID, ?string workspaceID): download
GET/v1/files/{file_id}/content
Obter metadados do arquivo
$client->files->retrieveMetadata(string fileID, ?string workspaceID): FileMetadata
GET/v1/files/{file_id}
Excluir arquivo
$client->files->delete(string fileID, ?string workspaceID): DeletedFile
DELETE/v1/files/{file_id}
Criar skill
$client->skills->create(list<string> files, ?string displayName, ?string workspaceID): Skill
POST/v1/skills
Listar skills
$client->skills->list(?int limit, ?string page, ?string source, ?string workspaceID): PageCursor<Skill>
GET/v1/skills
Obter skill
$client->skills->retrieve(string skillID, ?string workspaceID): Skill
GET/v1/skills/{skill_id}
Excluir skill
$client->skills->delete(string skillID, ?string workspaceID): DeletedSkill
DELETE/v1/skills/{skill_id}