Discussions
OpenAI API compatibitlity
5 days ago by Stefan Korn
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: