DEVUP Docs
Back to Dashboard

Chat Completions

DEVUP AI provides an OpenAI-compatible Chat Completions endpoint for supported chat models. Note that feature and parameter support may vary by model.

POST
https://api.devupai.com/v1/chat/completions
For the modern Responses-style request interface, see Responses API.

Choose your SDK

npm install devupai

The DEVUP AI SDK provides native access to the platform. OpenAI SDKs can be used with the OpenAI-compatible endpoint by configuring the DEVUP AI base URL, API key, and model identifier.

Basic chat completion

By setting the baseURL and passing your DEVUP AI token, you can send requests directly to our optimized inference infrastructure.

from openai import OpenAI

openai = OpenAI(
    api_key="$DEVUP_API_KEY",
    base_url="https://api.devupai.com/v1",
)

chat_completion = openai.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(chat_completion.choices[0].message.content)
print(chat_completion.usage.prompt_tokens, chat_completion.usage.completion_tokens)

Multi-turn conversations

Models do not store memory. To maintain conversational state, you must pass the entire conversation history in the messages array on each request.

from openai import OpenAI

openai = OpenAI(
    api_key="$DEVUP_API_KEY",
    base_url="https://api.devupai.com/v1",
)

chat_completion = openai.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",
    messages=[
        {"role": "system", "content": "Respond like a michelin starred chef."},
        {"role": "user", "content": "Can you name at least two different techniques to cook lamb?"},
        {"role": "assistant", "content": "Bonjour! Let me tell you, my friend, cooking lamb is an art form..."},
        {"role": "user", "content": "Tell me more about the second method."},
    ],
)

print(chat_completion.choices[0].message.content)

Supported parameters

We support the majority of standard OpenAI chat completion parameters.

Required

model
stringrequired

ID of the model to use. See the model library for all available options.

messages
arrayrequired

A list of messages comprising the conversation so far.

Generation controls

max_tokens
integeroptionalrange: 1 - 32,768

The maximum number of tokens that can be generated in the chat completion.

temperature
numberoptionaldefault: 1range: 0 - 2

What sampling temperature to use. Higher values make output more random, lower values make it more focused.

top_p
numberoptionaldefault: 1range: 0 - 1

An alternative to sampling with temperature, called nucleus sampling.

stop
string / arrayoptional

Up to 4 sequences where the API will stop generating further tokens.

presence_penalty
numberoptionaldefault: 0range: -2.0 - 2.0

Positive values penalize new tokens based on whether they appear in the text so far.

frequency_penalty
numberoptionaldefault: 0range: -2.0 - 2.0

Positive values penalize new tokens based on their existing frequency in the text so far.

Streaming

stream
booleanoptionaldefault: false

If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events.

Structured output & tools

response_format
objectoptional

An object specifying the format that the model must output. Compatible with JSON mode and structured outputs.

tools
arrayoptional

A list of tools the model may call, and controls for which tool is called.

tool_choice
string / objectoptional

Controls which tool is called by the model.

Supported parameters and behavior may vary by model.

Max output tokens

Model limits

Due to hardware limits, there is a hard cap on how many output tokens models can generate in a single request. For models like DeepSeek V3, this is usually 8192 tokens.

Continuing responses

If a model stops generating because it reached the limit, the finish_reason will be length. You can send the truncated response back as an assistant message and the model will continue right where it left off.

Note: The model may repeat or overlap slightly when continuing. It is not always a completely seamless continuation.

bash
curl -X POST https://api.devupai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -d '{
    "model": "deepseek-ai/DeepSeek-V4-Pro",
    "messages": [
      {
        "role": "user",
        "content": "Write a 5,000 word essay on quantum physics."
      },
      {
        "role": "assistant",
        "content": "<previous truncated response>"
      }
    ]
  }'

What's Next