RedPajama-INCITE-7B-Instruct model to find the capital of France. For the full API reference, go to API Reference.
Prerequisites
Ensure you havecurl installed in your machine. Then launch your terminal and define your Together API key.
Send the curl Request
We’re going to send a POST request to api.together.xyz/v1/chat/completions with a JSON-formatted object that contains the model (model we want to query), messages (content to send to the model), and additional parameters such as temperature (randomness of the result) and max_tokens (max number of output tokens).
Output
output key contains the output of the model. The choices array contains the N-best responses from the model. In this example, the API returned one choice with the completion, “Paris”.
Streaming tokens
If you want to stream the response back, addstream_tokens: true.