RikkaHub Transit API Tutorial: Configuring your Android AI Chat Client
RikkaHub (Open-source Android AI chat client) tutorial: Create an sk- key, select the Provider type based on the model group, configure the Base URL, and easily call Gemini / Claude / GPT models.
1. What is RikkaHub?
RikkaHub is an open-source Android AI chat client that supports various model channels such as Anthropic (Claude), OpenAI (GPT), and Google (Gemini). By pointing its Provider to a transit gateway and entering your sk- key, you can call various model series using your platform balance, with billing based on token usage.
2. Preparation
- Log in to the Jizhi API console and create an
sk-xxxxxxkey under "API Keys" (it will only be shown once, so please save it). - Confirm the model slug you wish to use (e.g.,
gemini-3.7-flash,claude-sonnet-5,gpt-5.5). You can view these under "Model ID" in the top right corner of the "Tokens" page in the console. - Confirm the gateway URL:
https://www.relay-api.com.
3. Configuring in RikkaHub
Open RikkaHub → "Settings" → "Providers" → click "+" in the top right corner to add a new one. Choose the Provider type based on the model you intend to use:
① Calling Gemini (Google type, recommended)
Provider Type : Google / Gemini
Base URL : https://www.relay-api.com/v1beta
API Key : sk-your-key
Model ID : gemini-3.7-flash
The Base URL must include /v1beta. RikkaHub automatically appends /models/{model}:generateContent to the Base URL; if /v1beta is missing, the request will hit /models/... and return a 404 (page not found) error.
② Calling Claude (Anthropic type)
Provider Type : Anthropic / Claude
Base URL : https://www.relay-api.com
API Key : sk-your-key
Model ID : claude-sonnet-5
For the Anthropic type, do not include /v1 in the Base URL. The client will append /v1/messages itself; adding it manually will result in /v1/v1/messages.
③ Calling GPT (OpenAI compatible type)
Provider Type : OpenAI Compatible
Base URL : https://www.relay-api.com/v1
API Key : sk-your-key
Model ID : gpt-5.5
4. Endpoint Address Reference
| Model Group | Provider Type | Base URL | Protocol |
|---|---|---|---|
| Gemini | Google / Gemini | https://www.relay-api.com/v1beta | Google generateContent |
| Claude | Anthropic | https://www.relay-api.com | Anthropic Messages |
| GPT | OpenAI Compatible | https://www.relay-api.com/v1 | OpenAI Chat Completions |
5. Important: Models are isolated by group; cross-group calls are not supported
The three protocols on this site are independent native entry points, and models are isolated by group:
- Gemini group models (like gemini-3.7-flash) must use the Google / Gemini provider type with
/v1beta. - Entering a Gemini model name into an Anthropic provider type will return
400 Claude model not enabled or does not exist: gemini-xxx. - Entering a Gemini model name into an OpenAI provider type will return
400 OpenAI model not enabled or does not exist: gemini-xxx.
Therefore, the "Model ID" and "Provider Type" must match: Use the Provider type that corresponds to the model group you are using.
6. Troubleshooting Common Issues
| Symptom | Cause and Solution |
|---|---|
Returns 404 (web/HTML) | The Base URL is missing the version suffix (e.g., Gemini missing /v1beta), causing the request to hit a non-existent path. Add /v1beta or /v1. |
Path shows /v1beta/v1beta/ or /v1/v1/ | The version number was repeated in the Base URL. Include the version only once. |
400 Claude/OpenAI model not enabled or does not exist: gemini-xxx | The model group does not match the provider type (e.g., Gemini model used in Claude/OpenAI type). Switch to the Google / Gemini type. |
401 / 403 | Invalid key, not enabled, insufficient balance, or the token lacks permission for this route/model. Verify the key and account balance. |
400 Request contains an invalid argument | Upstream validation for specific parameters (e.g., thinking budget casing, tool calls). If intermittent, it may be a temporary upstream fluctuation; simply retry. |
| Failed to fetch model list | Some clients are strict when parsing the model list returned by the relay. Simply switch to "Manually enter Model ID." |
7. Security Recommendations
- Do not write keys into public repositories or screenshots. It is recommended to use environment variables or local secure storage.
- Create a separate key for each device or tool to easily track usage and revoke access if necessary.
