Skip to main content

Completion

The Completion API endpoint (https://wnr.ai/api/v1/completion) is a powerful tool that enables you to provide a raw prompt to a language model, which it will then complete.

To use the endpoint, you can issue the following curl command:

curl -X POST 'https://wnr.ai/api/v1/completion' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"input": {
"prompt": "You are a helpful assistant. Answer as concisely as possible."
},
"model": "grace-chat-001",
"webhook": "https://yourwebsite.com"
}'

Here's a breakdown of each parameter used in the curl command:

  • prompt: The initial text or question that you want the model to complete. It can be a statement, a question, or any form of textual input. In this example, the prompt is "You are a helpful assistant. Answer as concisely as possible." The language model will interpret this prompt and generate a continuation.

  • model: The ID of the model you want to use for the conversation. For a list of available models, visit the /models endpoint.

  • webhook: The URL that the API will send the response to once it's ready.

This is a POST request and the content type should be application/json. The authorization is a bearer token, which should be your API key.

The Completion API endpoint provides an intuitive way to interact with the language models, enabling you to generate creative, insightful, and relevant text completions based on your given prompts.