Skip to content

Generative AI Service

This system provides a generative AI service based on large language models (LLMs). The API is OpenAI-compatible, so you can use it from your own machine or applications by simply switching the base URL of the OpenAI SDK or a compatible tool.

Item Value
Endpoint (base URL) https://api.rikyu.r-ccs.riken.jp/v1
API format OpenAI-compatible
Authentication API key (created in the RIKYU Portal)

Available Models

Model Parameters Context length Description Model card
qwen3.6-35b 35B 256K Standard model. Fast responses for general use Qwen/Qwen3.6-35B-A3B
qwen3.8-27b 27B 256K Compact model that accepts image input Qwen/Qwen3.8-27B
kimi-k2.6 1T 256K Large-scale model moonshotai/Kimi-K2.6
glm-5.2 753B 1M Model for long contexts zai-org/GLM-5.2
glm-5.3 753B 1M Newer version of glm-5.2 zai-org/GLM-5.3
glm-5.3-flash 320B 1M Model for long contexts and image input zai-org/GLM-5.3-Flash
deepseek-v4.1-flash 552B+196B 1M Suited to long inputs; accepts image input deepseek-ai/DeepSeek-V4.1-Flash
kimi-k3 2.8T 928K Largest model moonshotai/Kimi-K3

Parameters are total parameter counts. All models except qwen3.8-27b are MoE (Mixture of Experts) models, so the number of parameters actually used to generate a token is smaller. Context length is the maximum number of input tokens accepted by this service, which may differ from the model's native limit.

All models support reasoning and function calling.

In addition to text, qwen3.8-27b, glm-5.3-flash, and deepseek-v4.1-flash also accept image input. The other models are text-only.

Note

Models may be added or changed. You can retrieve the current list from /v1/models with your API key. See "Using curl" below for how to do this.

Creating an API Key

Create an API key in the RIKYU Portal.

RIKYU Portal

Log in to the portal and select API Keys at the top of the page. In the Create a new key form, choose a project ID and click CREATE.

Creating an API key

Warning

The key is shown only once, right after it is created. It cannot be retrieved again, so save it somewhere safe. If you lose it, revoke that key from the list and create a new one.

One key can be created per project. API usage is billed to the project the key was created for. If you belong to multiple projects, use the key for the project you want to use.

Warning

An API key is a credential for using this system. Do not share it with others, and do not write it directly in source code or public repositories. If there is any risk of leakage, revoke the key from the list in the portal and create a new one.

Using curl

Set your API key in an environment variable. OPENAI_API_KEY is the variable name that the OpenAI SDK and many compatible tools read by default.

export OPENAI_API_KEY=API_KEY

Retrieve the list of available models.

curl https://api.rikyu.r-ccs.riken.jp/v1/models \
    -H "Authorization: Bearer $OPENAI_API_KEY"

Generate text. Specify the model you want to use in model.

curl https://api.rikyu.r-ccs.riken.jp/v1/chat/completions \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "qwen3.6-35b",
      "messages": [
        {"role": "user", "content": "What is a supercomputer?"}
      ]
    }'

To receive the generated text incrementally, set stream to true.

curl https://api.rikyu.r-ccs.riken.jp/v1/chat/completions \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "qwen3.6-35b",
      "messages": [
        {"role": "user", "content": "What is a supercomputer?"}
      ],
      "stream": true
    }'

Using Python

Install the OpenAI Python library.

pip install openai

Specify the endpoint in base_url and your API key in api_key.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.rikyu.r-ccs.riken.jp/v1",
    api_key=os.environ["OPENAI_API_KEY"],
)

response = client.chat.completions.create(
    model="qwen3.6-35b",
    messages=[
        {"role": "user", "content": "What is a supercomputer?"},
    ],
)

print(response.choices[0].message.content)

To receive the generated text incrementally, specify stream=True.

stream = client.chat.completions.create(
    model="qwen3.6-35b",
    messages=[
        {"role": "user", "content": "What is a supercomputer?"},
    ],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)

Note

The models in this service are reasoning models. The reasoning that leads to the answer is stored in message.reasoning_content, not in message.content.

Using OpenAI-Compatible Applications

Any application that lets you configure the base URL and an API key, such as Cline (a Visual Studio Code extension), works as is. Configure it as follows.

Setting Value
API Provider OpenAI Compatible
Base URL https://api.rikyu.r-ccs.riken.jp/v1
API Key Your API key
Model ID The model to use (for example, qwen3.6-35b)

The names of the settings differ between applications, but any application that lets you configure the base URL, an API key, and a model name can be used in the same way.

Notes

  • If you do not specify max_tokens, the maximum number of tokens generated per request is 32,768. When you send a long input, adjust max_tokens so that the input plus max_tokens does not exceed the context length of the model. Exceeding it results in an error (HTTP 400).
  • The maximum request body size is 32 MB.
  • The request timeout is 600 seconds.
  • Only paths under /v1 are publicly available.

Usage Fees

The generative AI service is free of charge during Early Access Phase 2.

The usage fee described in Welcome (300 JPY per GPU hour) applies to compute jobs run with Slurm; the generative AI service is not subject to it. You can check your API usage on the usage page of the RIKYU Portal.