RikkaHub Transit API Tutorial: Configuring your Android AI Chat Client

  • 发布时间
  • 语言en

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

  1. Log in to the Jizhi API console and create an sk-xxxxxx key under "API Keys" (it will only be shown once, so please save it).
  2. 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.
  3. 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 GroupProvider TypeBase URLProtocol
GeminiGoogle / Geminihttps://www.relay-api.com/v1betaGoogle generateContent
ClaudeAnthropichttps://www.relay-api.comAnthropic Messages
GPTOpenAI Compatiblehttps://www.relay-api.com/v1OpenAI 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

SymptomCause 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-xxxThe model group does not match the provider type (e.g., Gemini model used in Claude/OpenAI type). Switch to the Google / Gemini type.
401 / 403Invalid 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 argumentUpstream 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 listSome 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.