Skip to main content
Generate intelligent responses using state-of-the-art language models including Llama, Mistral, and custom fine-tuned models available on the TensorOne platform.

Request Body

array
required
Array of message objects representing the conversation history
string
default:"llama-3.1-70b"
Model to use for completion. Available models:
  • llama-3.1-70b (Recommended)
  • llama-3.1-8b
  • mistral-7b
  • mixtral-8x7b
  • Custom fine-tuned models
integer
default:"1000"
Maximum number of tokens to generate in the response
number
default:"0.7"
Controls randomness. 0.0 is deterministic, 1.0 is very creative
number
default:"0.9"
Controls diversity via nucleus sampling
boolean
default:"false"
Whether to stream the response as it’s generated

Response

array
Array of completion choices
object
Token usage statistics

Example

Streaming

For real-time applications, you can stream responses as they’re generated:

Best Practices

  • Use system messages to provide context and instructions
  • Adjust temperature based on your use case (lower for factual, higher for creative)
  • Monitor token usage to optimize costs
  • Implement retry logic for production applications
  • Use streaming for better user experience in chat applications