API Reference
API reference
Customize your phospho experience with the API
Most phospho features are available through the API. The URL of the phospho API is https://api.phospho.ai/v2
Read the API documentation here!
For example, this will log a task to phospho:
curl -X POST https://api.phospho.ai/v2/log/$PHOSPHO_PROJECT_ID \
-H "Authorization: Bearer $PHOSPHO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"batched_log_events": [
{
"input": "your_input",
"output": "your_output"
}
]
}'
User Feedback
In your app, you may have thumbs up and thumbs down next to your chat messages. Using the API, you can directly log them to phospho.
curl -X POST https://api.phospho.ai/v2/tasks/TASK_ID/flag \
-H "Authorization: Bearer $PHOSPHO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flag": "success",
"source": "user"
}'
Pass "flag": "success"
or "flag": "failure"
to the app.
Dedicated endpoints
Contact us at contact@phospho.app to discuss integrating phospho into your products through dedicated endpoints, allowing seamless, behind-the-scenes functionality for your customers.
Was this page helpful?