Overview #
Our Completions API allows you to send text to our AI engine and receives a response based on your input.
Request #
To interact with the Completions API, send a POST request to the following URL:
POST https://ai.bluehive.com/api/v1/completion
The request should include the following JSON payload:
{
"prompt": "Hello, world!",
"systemMessage": "You are a helpful chatbot named Will."
}
Response #
The API will return a JSON response structured as follows:
{
"logId": "zucj6bL6cx4FfGXnA", // BlueHive Event Log ID
"status": 200,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello, human!",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
]
}
Example #
Here is an example of how to use the Completions API with curl
:
curl -X POST https://ai.bluehive.com/api/v1/completion \
-H "Authorization: Bearer BHSK-sandbox-SAMPLE" \
-H "Content-Type: application/json" \
-d '{ "prompt": "Hello, world!", "systemMessage": "You are a helpful chatbot named Will." }
Conclusion #
The Completions API is a powerful tool for integrating AI-driven responses into your applications. Make sure to format your requests correctly and handle the responses appropriately for the best experience.