Skip to main content

Neosantara

Overview​

PropertyDetails
DescriptionNeosantara provides an OpenAI-compatible API for chat completions and the Responses API.
Provider Route on LiteLLMneosantara/
Link to Provider DocNeosantara ↗
Base URLhttps://api.neosantara.xyz/v1
Supported Operations/chat/completions, /responses, function calling


We support Neosantara models through the neosantara/ prefix in LiteLLM.

Required Variables​

Environment Variables
os.environ["NEOSANTARA_API_KEY"] = ""  # your Neosantara API key

A free-tier Neosantara account can call gemini-3.1-flash-lite, which the examples on this page use. Some models, such as gemini-3.5-flash, answer 403 insufficient_tier until the account has deposited credits.

You can override the default base URL with:

Optional Base URL Override
os.environ["NEOSANTARA_API_BASE"] = "https://api.neosantara.xyz/v1"

Usage - LiteLLM Python SDK​

Non-streaming​

Neosantara Non-streaming Completion
import os
from litellm import completion

os.environ["NEOSANTARA_API_KEY"] = ""

response = completion(
model="neosantara/gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "Hello from LiteLLM"}],
max_tokens=64,
)

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

Streaming​

Neosantara Streaming Completion
import os
from litellm import completion

os.environ["NEOSANTARA_API_KEY"] = ""

response = completion(
model="neosantara/gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "Write a one-line poem about Jakarta"}],
max_tokens=64,
stream=True,
)

for chunk in response:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")

Function Calling​

Chat Completions​

Function calling works on Neosantara through completion(). Depending on the model, LiteLLM may require explicitly allowing the OpenAI params on this provider route.

Neosantara Function Calling via completion()
import os
from litellm import completion

os.environ["NEOSANTARA_API_KEY"] = ""

response = completion(
model="neosantara/gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "What is the weather in Jakarta? Use the tool."}],
tools=[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather by city name",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"}
},
"required": ["city"]
}
}
}
],
tool_choice="auto",
allowed_openai_params=["tools", "tool_choice"],
max_tokens=128,
)

print(response.choices[0].message.tool_calls)

Responses API​

Neosantara also supports LiteLLM's responses() interface.

Neosantara Responses API
import os
from litellm import responses

os.environ["NEOSANTARA_API_KEY"] = ""

response = responses(
model="neosantara/gemini-3.1-flash-lite",
input="Reply with exactly: pong",
max_output_tokens=8,
)

print(response.output_text)

Responses API Tool Calling​

Function calling also works through responses():

Neosantara Function Calling via responses()
import os
from litellm import responses

os.environ["NEOSANTARA_API_KEY"] = ""

response = responses(
model="neosantara/gemini-3.1-flash-lite",
input="What is the weather in Jakarta? Use the tool.",
tools=[
{
"type": "function",
"name": "get_weather",
"description": "Get weather by city name",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"}
},
"required": ["city"]
}
}
],
max_output_tokens=128,
)

print(response.output)

Parameter Compatibility​

LiteLLM maps max_completion_tokens to max_tokens for Neosantara automatically.

Neosantara max_completion_tokens Compatibility
import os
from litellm import completion

os.environ["NEOSANTARA_API_KEY"] = ""

response = completion(
model="neosantara/gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "Summarize LiteLLM in one sentence"}],
max_completion_tokens=64,
)

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

Reasoning Effort​

LiteLLM can pass reasoning_effort through to Neosantara, but like tool calling on completion(), you should explicitly allow the parameter on this provider route.

Neosantara reasoning_effort
import os
from litellm import completion

os.environ["NEOSANTARA_API_KEY"] = ""

response = completion(
model="neosantara/gemini-3.1-flash-lite",
messages=[{"role": "user", "content": "Reply with exactly: reasoned"}],
reasoning_effort="high",
allowed_openai_params=["reasoning_effort"],
max_tokens=8,
)

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

Usage - LiteLLM Proxy​

Add the following to your LiteLLM Proxy configuration file:

config.yaml
model_list:
- model_name: neosantara-gemini-flash-lite
litellm_params:
model: neosantara/gemini-3.1-flash-lite
api_key: os.environ/NEOSANTARA_API_KEY

general_settings:
master_key: os.environ/LITELLM_MASTER_KEY

Start your LiteLLM Proxy server:

Start LiteLLM Proxy
export NEOSANTARA_API_KEY="your-neosantara-api-key"
export LITELLM_MASTER_KEY="${LITELLM_MASTER_KEY:-sk-$(openssl rand -hex 16)}"
printf 'Local proxy key: %s\n' "$LITELLM_MASTER_KEY"
litellm --config config.yaml

# RUNNING on http://0.0.0.0:4000

In another terminal, set LITELLM_MASTER_KEY to the key printed above and call the proxy:

Neosantara via Proxy - OpenAI SDK
import os
from openai import OpenAI

client = OpenAI(
base_url="http://localhost:4000",
api_key=os.environ["LITELLM_MASTER_KEY"],
)

response = client.chat.completions.create(
model="neosantara-gemini-flash-lite",
messages=[{"role": "user", "content": "Say hello from the proxy"}],
)

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

Tools and reasoning_effort on the Proxy​

Depending on the model, the proxy can answer 400 UnsupportedParamsError to tools, tool_choice, parallel_tool_calls, or reasoning_effort, as it does for glm-4.7-flash. Allow the params on the deployment, the same way allowed_openai_params works on completion():

config.yaml
model_list:
- model_name: neosantara-glm-flash
litellm_params:
model: neosantara/glm-4.7-flash
api_key: os.environ/NEOSANTARA_API_KEY
allowed_openai_params: ["tools", "tool_choice", "parallel_tool_calls", "reasoning_effort"]

Spend Tracking on the Proxy​

Neosantara models are not in LiteLLM's model cost map, so the proxy records $0 spend for them and key or team budgets never move. To track spend, set input_cost_per_token and output_cost_per_token in litellm_params, as shown in Custom Pricing. Both are in USD per token, so divide a Neosantara price per million tokens by 1,000,000.

Notes​

  • Use the neosantara/ model prefix when calling Neosantara through LiteLLM.
  • The default auth env var is NEOSANTARA_API_KEY.
  • NEOSANTARA_API_BASE can be used to point LiteLLM at a custom Neosantara-compatible base URL.
  • max_completion_tokens is mapped to max_tokens automatically.
  • On completion() and on the proxy, tools, tool_choice, parallel_tool_calls, and reasoning_effort may require allowed_openai_params so LiteLLM will pass them through.