How to connect Qchat AI Compare to an OpenAI-compatible service
Whether you use a hosted service such as OpenRouter or a local service such as Ollama or LM Studio, the core configuration is the same: Base URL, API key, and model name. What changes is where the key comes from and how your iPhone reaches the machine running the service.
The universal setup flow
Do not start inside Qchat. First confirm three things with the service provider: the API entry URL, the access credential, and an available model name. Then return to Qchat, enter them, and test with a short question that contains no sensitive information.
- Base URL: copy it completely; do not add
/v1from memory - API key: create it only on the official page; local services may not require one or may let you configure a token
- Model name: use the exact identifier shown by the provider or local tool
- Test prompt: short, ordinary, and free of private or account information
Hosted example: OpenRouter
OpenRouter’s official OpenAI-compatible Base URL is https://openrouter.ai/api/v1. You first register or sign in, then open the Keys page and create an API key. Because the Keys page contains account data, this guide uses only the public sign-in screen visible while signed out; treat your signed-in interface as the source of truth.
After creating the key, paste it into Qchat and copy the exact model identifier you want from OpenRouter’s model list. Model prices and context capabilities differ, so confirm them on OpenRouter first.
- Base URL:
https://openrouter.ai/api/v1 - API key: sign in to OpenRouter and create it on the Keys page
- Model name: copy the exact slug from OpenRouter Models
- Reminder: keep keys only in your own devices and provider accounts; never send them to support or expose them in screenshots
Local services: Ollama and LM Studio
Ollama and LM Studio are local services, not cloud account systems, so there is usually no web page where you “apply for an API key.” Start their local API server, confirm the port and model name, then make sure your iPhone can reach the computer over the LAN.
Ollama’s official OpenAI-compatible example uses http://localhost:11434/v1; LM Studio’s uses http://localhost:1234/v1. But localhost means the computer running the service. From an iPhone, you normally replace localhost with the computer’s LAN IP and enable LAN access according to the tool’s documentation.
- Ollama commonly uses port
11434; the model name depends on the models you pulled locally - LM Studio commonly uses port
1234; use the identifier shown inside LM Studio - Local services may not require a key, or may let you configure an access token; check the current version’s settings
- If the service listens only on
127.0.0.1, an iPhone on the same LAN usually cannot reach it
What to check when connection fails
First confirm that the phone can reach the address. For hosted services, check network access and account allowance. For local services, check whether the computer and phone are on the same network, whether the server is running, whether the firewall allows it, and whether the listen address is exposed to the LAN.
Then check the exact model name. Many failures are not bad keys; they are missing prefixes, version suffixes, or capitalization differences. Rotate a key only as a last step, and never send the old key to anyone for troubleshooting.
Frequently asked questions
Where do I apply for an API key for Ollama or LM Studio?
Usually you do not apply for one as with a cloud service, because they run on your own computer. Whether you can configure an access token depends on the current version; Base URL, port, listen address, and model name matter more.
Can I enter localhost directly in Qchat?
Not when the service runs outside the iPhone, because localhost would point back to the phone itself. Use the LAN address of the computer running the service and make sure that service allows LAN access.
Does this tutorial mean every service works exactly the same way?
No. It is a universal configuration framework. Exact menus, model names, and security settings depend on each provider’s official documentation and current version.
Understand the interface before connecting safely
If Base URL, API key, and model name are still unfamiliar, read the concept guide first. If you already understand them, return to BYOK to review the data and cost boundary.