Discussions

Ask a Question
Back to all

OpenAI API compatibitlity

To be compatible with OpenAI API implementation Voyage AI API should also deliver "prompt_tokens" in the "usage" part of the response for Embeddings.

OpenAI API is delivering this beside "total_tokens": https://platform.openai.com/docs/api-reference/embeddings/create

If "prompt_tokens" is missing in the response , the OpenAI PHP client https://github.com/openai-php/client will raise an exception for example. You can see OpenAI PHP Client requiring the "prompt_tokens" here:

https://github.com/openai-php/client/blob/6404b5f34abddd0245f640b2e14cd1cb12f3fe48/src/Responses/Embeddings/CreateResponseUsage.php#L10