Network & Connectivity
Endpoints
Choose the Base URL that matches your client's protocol:
| Scenario | Base URL | Description |
|---|---|---|
| OpenAI Compatible | https://api.portal.aiin1.ai/v1 |
For OpenAI SDK, Cursor, Cline, Continue, Cherry Studio |
| Anthropic Native | https://api.portal.aiin1.ai |
For Claude Code, Anthropic SDK |
| Gemini Native | https://api.portal.aiin1.ai |
For Google Gemini SDK, custom gateway aggregation |
Use Streaming Mode
We recommend enabling
stream: truefor all interactive scenarios. In streaming mode, time-to-first-token drops to 2-3 seconds. Non-streaming requests must wait for the model to generate the entire response before returning, which can time out when the model produces longer outputs.
If you encounter response timeouts or empty responses in clients such as Cherry Studio or ChatBox, first check whether streaming mode is enabled.
Connection Troubleshooting
- Verify the Base URL matches your client's protocol.
- Ensure your network allows outbound access to
api.portal.aiin1.ai. - Check whether proxies, firewalls, or gateways are blocking HTTPS long-lived connections or SSE streams.
- Verify that local DNS resolution and certificate validation are working correctly.
- If responses time out or return no content: Confirm that your request includes
"stream": true. Non-streaming requests may time out when the model generates lengthy output.
OpenAI-Compatible Example (Streaming)
curl https://api.portal.aiin1.ai/v1/chat/completions \
-H "Authorization: Bearer sk-nex-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256,
"stream": true
}'Anthropic Messages API Example (Streaming)
curl https://api.portal.aiin1.ai/v1/messages \
-H "x-api-key: sk-nex-your-key-here" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 256,
"stream": true
}'If your client only asks for a Base URL, use https://api.portal.aiin1.ai for Anthropic native clients. The SDK will automatically append /v1/messages as required by the protocol.