Relay365Multi-model API relay desk
← All desk bulletins
Field notes from the deskEN1 desk reads

Shift Note: A Terminal Assistant Before Clock-Out

A useful first AI project can be small enough to finish before clock-out: type a question in your terminal, send it to a model, and print the answer. Start with a helper that explains unfamiliar commands or turns rough notes into a checklist. That gives you something useful while keeping the moving parts visible.

For this afternoon, keep the assistant limited to answering questions. You will decide whether to use its suggestions. Automatic command execution can wait until you have experience checking its output.

The afternoon target is one question and one answer

Your assistant needs three things: a short program, an API key, and access to a model. An API is a way for your program to send a request to another service. The key identifies your account, and the model produces the response.

Relay365 fits here if you want a pay-as-you-go relay desk for multiple model families through one connection. It works with any OpenAI SDK, including the Python library used below. Its API base is https://api.api365relay.com; OpenAI clients add /v1. You can consider a model such as Gemini 2.5 Flash, using the exact model identifier shown in the service’s model listing.

Prepare a small folder and an isolated Python environment

You will need Python installed and a terminal. These setup commands assume macOS or Linux with Bash. Make a folder with mkdir afternoon-assistant, then enter it with cd afternoon-assistant.

Run python3 -m venv .venv, followed by source .venv/bin/activate. This creates and activates a separate place for the project’s Python packages. Then run python -m pip install openai to install the client library.

Keep your key outside the program. In Bash, run read -r -s -p 'API key: ' OPENAI_API_KEY, paste the key, and press Enter. The input stays hidden. Run export OPENAI_API_KEY afterward so Python can read it.

Set the model with export MODEL_ID='replace-with-the-exact-model-id'. Replace the placeholder with an identifier available to your account. A model’s display name may differ from the identifier accepted by the API.

Put the entire first assistant in one file

Create a file named assistant.py in your project folder. Paste the following as one line of Python. The semicolons separate its instructions, allowing this small starter program to fit on a single line.

import os, sys; from openai import OpenAI; client = OpenAI(api_key=os.environ['OPENAI_API_KEY'], base_url='https://api.api365relay.com/v1', timeout=30.0, max_retries=0); question = ' '.join(sys.argv[1:]).strip() or 'Suggest three useful questions for a terminal assistant.'; response = client.chat.completions.create(model=os.environ['MODEL_ID'], messages=[{'role': 'system', 'content': 'You are a practical terminal assistant. Answer briefly in plain English. Explain suggested commands and flag destructive actions.'}, {'role': 'user', 'content': question}]); print(response.choices[0].message.content or 'No text returned.')

The program reads your terminal arguments, sends them as a question, and prints the returned text. The system message sets the assistant’s general behavior. The user message carries your actual question. Each run starts a fresh conversation; this version has no memory.

Try python assistant.py 'Explain what pwd does and give one example.' The quotation marks keep your question together as one argument. Only the question and the instruction in the script are sent; this program does not read your project files.

Check useful behavior before adding features

  • Ask about a command you already understand, then check the explanation against its manual.
  • Ask it to turn three invented maintenance notes into a checklist, and check whether it preserves every task.
  • Try an invalid model identifier once so you recognize the resulting error, then restore the correct value.

If authentication fails, check the key. If the model is unavailable, check its identifier and your account’s access. A timeout means the request did not finish within the configured wait. This starter script displays Python errors directly; friendlier error messages make a sensible next improvement.

Leave the next shift a manageable starting point

Review usage and pricing while testing, and keep confidential material out of early experiments. If this connection suits your project, create a Relay365 account and begin with a few short requests.

Save three prompts that worked well. Next afternoon, split the script into readable lines and add clear error handling. You will already have a working assistant whose behavior you can inspect and improve.

Further desk bulletins

Curious how it runs on your own code? Sign up →