cURL
curl --request POST \ --url https://api.edenai.run/v3/llm/v1/messages/count_tokens \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "<string>", "messages": [ { "role": "user", "content": "<string>" } ], "system": "<string>", "tools": [ {} ], "tool_choice": {} } '
{ "detail": [ { "loc": [ "<string>" ], "msg": "<string>", "type": "<string>" } ] }
Count input tokens for an Anthropic-format request without running the model.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Body for /v1/messages/count_tokens — same fields as messages but max_tokens is optional.
Show child attributes
Successful Response
Was this page helpful?
Contact support