Skip to main content
POST
/
v1
/
completions
curl https://gateway.bud.studio/v1/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo-instruct",
    "prompt": "Write a tagline for an ice cream shop.",
    "max_tokens": 50,
    "temperature": 0.7
  }'
{
  "id": "cmpl-abc123",
  "object": "text_completion",
  "created": 1699000000,
  "model": "gpt-3.5-turbo-instruct",
  "choices": [
    {
      "text": "\n\nSweet moments, one scoop at a time.",
      "index": 0,
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 12,
    "total_tokens": 22
  }
}
curl https://gateway.bud.studio/v1/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo-instruct",
    "prompt": "Write a tagline for an ice cream shop.",
    "max_tokens": 50,
    "temperature": 0.7
  }'
{
  "id": "cmpl-abc123",
  "object": "text_completion",
  "created": 1699000000,
  "model": "gpt-3.5-turbo-instruct",
  "choices": [
    {
      "text": "\n\nSweet moments, one scoop at a time.",
      "index": 0,
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 12,
    "total_tokens": 22
  }
}

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer authentication header

Body

ParameterTypeRequiredDescription
modelstringYesModel identifier to use for completion
promptstring or arrayYesText prompt(s) to complete. Can be a single string or array of strings
suffixstringNoText to append after completion for insert mode
max_tokensintegerNoMaximum tokens to generate. Default: 16
temperaturefloatNoSampling temperature (0.0 to 2.0). Default: 1.0
top_pfloatNoNucleus sampling parameter. Default: 1.0
nintegerNoNumber of completions to generate. Default: 1
streambooleanNoEnable streaming response. Default: false
logprobsintegerNoInclude log probabilities on the most likely tokens
echobooleanNoEcho back the prompt in addition to completion. Default: false
stopstring or arrayNoSequences where the API will stop generating
presence_penaltyfloatNoPenalize new tokens based on presence (-2.0 to 2.0). Default: 0
frequency_penaltyfloatNoPenalize new tokens based on frequency (-2.0 to 2.0). Default: 0
repetition_penaltyfloatNoPenalize token repetition. Default: 1.0
best_ofintegerNoGenerate n completions server-side and return the best
logit_biasobjectNoModify likelihood of specified tokens
userstringNoUnique identifier representing your end-user
seedintegerNoRandom seed for deterministic sampling
ignore_eosbooleanNoContinue generating until max_tokens is reached. Default: false

Supported Providers

OpenAI

GPT-3.5 Turbo Instruct for legacy completions

Azure OpenAI

Enterprise completions deployments

Together AI

Llama, Mixtral, and open-source models

Fireworks

Fast completions for various LLMs