OpenAI Compatibility
Use ASI:One’s API with OpenAI’s client libraries for seamless integration.
Overview
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.
API Compatibility
Standard OpenAI Parameters
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 responses
ASI:One-Specific Parameters
These ASI:One-specific parameters are also supported:
web_search- Enable web search capabilitiesx-session-id- Session ID for agentic model persistence (header)- Tool calling parameters for Agentverse marketplace agent integration
See API Reference for complete parameter details.
Examples with OpenAI SDK
Python
JavaScript
Install the OpenAI library: pip install openai
Understanding the Response Structure
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 process
Python
JavaScript
LangChain Integration
ASI1’s OpenAI compatibility means you can use it directly with LangChain’s ChatOpenAI class. Simply configure the base URL and API key.
Python
Install LangChain: pip install langchain-openai
LangChain with Session Persistence
For agentic workflows that require session persistence, pass the session ID via default headers:
Next Steps
Ready to get started with ASI:One’s OpenAI-compatible API? Here’s what to do next:
- Get your API key - Sign up and create your ASI:One API key
- Try the quickstart - Make your first API call in minutes
- Agentverse marketplace - Discover the power of Agentverse marketplace integration
- Learn about tool calling - Extend your applications with custom functions