Neosantara

Use Neosantara models in Kern agents.

Neosantara is an LLM Gateway from Indonesia that provides a unified interface to access multiple AI models. See their library of models here and explore their documentation here.

Authentication

Set your NEOSANTARA_API_KEY environment variable. Get your key from Neosantara here.

1export NEOSANTARA_API_KEY=***
1setx NEOSANTARA_API_KEY ***

Example

Use Neosantara with your Agent:

1from kern.agent import Agent
2from kern.models.neosantara import Neosantara
3
4agent = Agent(
5 model=Neosantara(id="grok-4.1-fast-non-reasoning"),
6 markdown=True,
7)
8
9# Print the response in the terminal
10agent.print_response("Share a 2 sentence horror story")
Note View more examples here.

Params

ParameterTypeDefaultDescription
idstr"grok-4.1-fast-non-reasoning"The ID of the Neosantara model to use
namestr"Neosantara"The name of this chat model instance
providerstr"Neosantara"The provider of the model
api_keyOptional[str]NoneThe API key for Neosantara (defaults to NEOSANTARA_API_KEY env var)
base_urlstr"https://api.neosantara.xyz/v1"The base URL for the Neosantara API

Neosantara also supports the params of OpenAI.