API Reference

Create Completion

Description

Given a user's input, runs LLM inference to produce the model's response.

Details

LLM completions have many use cases, such as content summarization, question-answering, and text generation.

The model parameter determines which LLM will be used to generate the completion. Keep in mind that different models have varying sizes, costs, and may perform differently across different tasks.

The user input, commonly referred to as the "prompt", is a required field in the request body. The quality of the model's response can vary greatly depending on the input prompt. Good prompt engineering can significantly enhance the response quality. If you encounter suboptimal results, consider writing more specific instructions or providing examples to the LLM before trying more expensive techniques such as swapping in other models or finetuning.

By default, the endpoint will return the entire response as one whole object. If you would prefer to stream the completion in real-time, you can achieve this by setting the stream flag to true.

Log in to see full request history
Body Params
string

The account ID to use for usage tracking. This will be gradually enforced.

required

The ID of the model to use for completions.

Users have two options:

  • Option 1: Use one of the supported models from the dropdown.
  • Option 2: Enter the ID of a custom model.

Note: For custom models we currently only support models finetuned using using the Scale-hosted LLM-Engine API.

string
required

Prompt for which to generate the completion.

Good prompt engineering is crucial to getting performant results from the model. If you are having trouble getting the model to perform well, try writing a more specific prompt here before trying more expensive techniques such as swapping in other models or finetuning the underlying LLM.

images
array of objects

List of image urls to be used for image based completions. Leave empty for text based completions.

Images
model_parameters
object

Configuration parameters for the completion model, such as temperature, max_tokens, and stop_sequences.

If not specified, the default value are:

  • temperature: 0.2
  • max_tokens: None (limited by the model's max tokens)
  • stop_sequences: None
boolean
Defaults to false

Whether or not to stream the response.

Setting this to True will stream the completion in real-time.

Responses

Language
Credentials
Request
Click Try It! to start a request and see the response here! Or choose an example:
application/json