Create Chat
Create a new chat instance to interact with AI models.Constructor
Parameters
Configuration object for the chat instance
Your API key for authentication
The AI model to use for chat completions
Maximum number of tokens in the response
Controls randomness in responses (0-1)
Request timeout in milliseconds
Custom base URL for the API endpoint
Response
Returns aChat
instance that can be used to send messages and stream responses.
Example
Available Models
The 0G AI SDK connects to models running on the 0G decentralized compute network:Model | Provider Address | Description | Verification |
---|---|---|---|
llama-3.3-70b-instruct | 0xf07240Efa67755B5311bc75784a061eDB47165Dd | State-of-the-art 70B parameter model for general AI tasks | TEE (TeeML) |
deepseek-r1-70b | 0x3feE5a4dd5FDb8a32dDA97Bed899830605dBD9D3 | Advanced reasoning model optimized for complex problem solving | TEE (TeeML) |
Error Handling
The constructor will throw an error if:- No API key is provided and
ZG_API_KEY
environment variable is not set - Invalid configuration parameters are passed