Use ASI:Oneās API with OpenAIās client libraries for seamless integration.
ASI:Oneās API is fully compatible with OpenAIās Chat Completions API format. This means you can use existing OpenAI client libraries and simply change the base URL to start using ASI:Oneās agentic models with Agentverse marketplace integration.
These parameters work exactly the same as OpenAIās API:
model - Model name (use ASI:One model names)messages - Chat messages arraytemperature - Sampling temperature (0-2)max_tokens - Maximum tokens in responsetop_p - Nucleus sampling parameterfrequency_penalty - Frequency penalty (-2.0 to 2.0)presence_penalty - Presence penalty (-2.0 to 2.0)stream - Enable streaming responsesThese ASI:One-specific parameters are also supported:
web_search - Enable web search capabilitiesx-session-id - Session ID for agentic model persistence (header)See API Reference for complete parameter details.
Install the OpenAI library: pip install openai
After making a request, your response object includes both standard OpenAI fields and ASI:One-specific fields:
choices[0].message.content: The main model responsemodel: The model usedusage: Token usage detailsexecutable_data: (ASI:One) Agent manifests and tool calls from Agentverse marketplaceintermediate_steps: (ASI:One) Multi-step reasoning tracesthought: (ASI:One) Model reasoning processASI1ās OpenAI compatibility means you can use it directly with LangChainās ChatOpenAI class. Simply configure the base URL and API key.
Install LangChain: pip install langchain-openai
For agentic workflows that require session persistence, pass the session ID via default headers:
Ready to get started with ASI:Oneās OpenAI-compatible API? Hereās what to do next: