Skip to main content
Access n1n.ai models through an OpenAI-compatible interface.

Authentication

Set the N1N_API_KEY environment variable:
export N1N_API_KEY=your-api-key

Parameters

ParameterTypeDefaultDescription
idstr"gpt-4o"The ID of the model to use
namestr"N1N"The name of the model
providerstr"N1N"The provider of the model
api_keyOptional[str]NoneThe API key (defaults to N1N_API_KEY env var)
base_urlstr"https://api.n1n.ai/v1"The base URL for the N1N API
N1N extends the OpenAI-compatible interface and supports most parameters from OpenAILike.

Usage

Basic

from agno.agent import Agent
from agno.models.n1n import N1N

agent = Agent(model=N1N(id="gpt-4o"), markdown=True)

agent.print_response("Share a 2 sentence horror story.")

With Tools

from agno.agent import Agent
from agno.models.n1n import N1N
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=N1N(id="gpt-5-mini"),
    markdown=True,
    tools=[WebSearchTools()],
)

agent.print_response("What is happening in France?", stream=True)