Myriaxon RouterMyriaxon Router
One API for Myriaxon's models. It speaks the same language as OpenAI's chat API, so most programs, libraries and coding tools work by changing two settings: the address and the key. You pay from a prepaid balance that you top up by bank transfer.
Satu API untuk model-model Myriaxon. Bahasanya sama dengan API chat OpenAI, jadi sebagian besar program, pustaka, dan alat coding bekerja hanya dengan mengubah dua pengaturan: alamat dan kunci. Anda membayar dari saldo prabayar yang diisi lewat transfer bank.
Base addressAlamat dasar
https://api.myriaxon.com/v11. Quick start1. Mulai cepat
- Open myriaxon.com/app/#/router and sign in with Google (or make an account with a password). The same account works for the Myriaxon agent.
- Top up. Choose an amount in rupiah, transfer exactly the amount shown to the bank account on the page, and upload the receipt. The owner checks it against the bank statement and credits your balance (see Topping up).
- Make a key under "API keys". Copy it at once: it is shown only one time.
- Call the API:
- Buka myriaxon.com/app/#/router dan masuk dengan Google (atau buat akun dengan kata sandi). Akun yang sama berlaku untuk agen Myriaxon.
- Isi saldo. Pilih jumlah dalam rupiah, transfer persis sejumlah yang tertera ke rekening bank di halaman itu, lalu unggah bukti transfer. Pemilik mencocokkannya dengan mutasi bank dan mengkredit saldo Anda (lihat Isi saldo).
- Buat kunci di "API keys". Salin segera: hanya ditampilkan satu kali.
- Panggil API:
curl
curl https://api.myriaxon.com/v1/chat/completions \
-H "Authorization: Bearer $MYRIAXON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "myriaxon-large",
"messages": [{"role": "user", "content": "Hello! Who are you?"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.myriaxon.com/v1", api_key="myx_sk_...")
reply = client.chat.completions.create(
model="myriaxon-large",
messages=[{"role": "user", "content": "Hello! Who are you?"}],
)
print(reply.choices[0].message.content)JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.myriaxon.com/v1", apiKey: process.env.MYRIAXON_API_KEY });
const reply = await client.chat.completions.create({
model: "myriaxon-large",
messages: [{ role: "user", content: "Hello! Who are you?" }],
});
console.log(reply.choices[0].message.content);2. Models and prices2. Model dan harga
Use the model's id as model. Prices are US$ per million tokens. A cached input token (the repeated start of a long conversation) costs the cached price. GET /v1/models always shows the current prices.
Pakai id model sebagai model. Harga dalam US$ per sejuta token. Token input yang ter-cache (bagian awal percakapan panjang yang berulang) dikenai harga cache. GET /v1/models selalu menampilkan harga terkini.
| id | Input | Output | Cached input | Good forCocok untuk |
|---|---|---|---|---|
myriaxon-largeMyriaxon-Large | $0.27 | $1.08 | $0.045 | The most capable: long reasoning, coding, agents, tool use.Paling mampu: penalaran panjang, coding, agen, penggunaan tool. |
myriaxon-mediumMyriaxon-Medium | $0.21 | $0.84 | $0.035 | Balanced; reads pictures itself: documents, screenshots, charts.Seimbang; membaca gambar sendiri: dokumen, tangkapan layar, grafik. |
myriaxon-smallMyriaxon-Small | $0.15 | $0.60 | $0.025 | Fast and cheap: classification, extraction, routing, high volume.Cepat dan murah: klasifikasi, ekstraksi, routing, volume tinggi. |
All three accept pictures (see Pictures). The exact price list is also shown on your router page, and the owner may adjust it: the price at the time of the call is the one charged.
Ketiganya menerima gambar (lihat Gambar). Daftar harga persis juga tampil di halaman router Anda, dan pemilik dapat menyesuaikannya: harga saat panggilan dilakukan yang dikenakan.
GET /v1/models needs no key. GET /v1/models/myriaxon-large returns one.
GET /v1/models tidak memerlukan kunci. GET /v1/models/myriaxon-large mengembalikan satu model.
3. Keys3. Kunci
Send your key as a bearer token: Authorization: Bearer myx_sk_.... A key is myx_sk_ and 43 characters. You can have up to five, for example one per program, and revoke any of them at once on your router page: a revoked key is refused immediately.
- Keep keys on a server. Anyone who has a key can spend your balance. Never put one in a web page, a mobile app, or a public repository. If one leaks, revoke it and make another.
- The whole key is shown once. Only a fingerprint of it is stored here, so nobody, including the owner, can read it back.
- Too many requests with a wrong key from one address are refused for ten minutes.
Kirim kunci sebagai bearer token: Authorization: Bearer myx_sk_.... Kunci berbentuk myx_sk_ diikuti 43 karakter. Anda boleh punya hingga lima, misalnya satu per program, dan mencabut salah satunya seketika di halaman router Anda: kunci yang dicabut langsung ditolak.
- Simpan kunci di server. Siapa pun yang memegang kunci dapat memakai saldo Anda. Jangan taruh di halaman web, aplikasi seluler, atau repositori publik. Jika bocor, cabut lalu buat yang baru.
- Kunci lengkap hanya ditampilkan sekali. Yang disimpan di sini hanya sidik jarinya, jadi tak seorang pun, termasuk pemilik, dapat membacanya kembali.
- Terlalu banyak permintaan dengan kunci salah dari satu alamat akan ditolak selama sepuluh menit.
4. Chat completions4. Chat completions
POST https://api.myriaxon.com/v1/chat/completions
| FieldBidang | MeaningArti |
|---|---|
model | Required. myriaxon-large, myriaxon-medium or myriaxon-small.Wajib. myriaxon-large, myriaxon-medium, atau myriaxon-small. |
messages | Required. A list of {role, content} with roles system, user, assistant, tool. content may be text or a list of parts (text and pictures).Wajib. Daftar {role, content} dengan peran system, user, assistant, tool. content boleh teks atau daftar bagian (teks dan gambar). |
stream | true sends the reply as it is written (Streaming).true mengirim jawaban saat ditulis (Streaming). |
max_tokens / max_completion_tokens | The longest reply you accept. At most 32,768. If you give none, the router uses 32,768 or what your balance can pay for, whichever is less.Jawaban terpanjang yang Anda terima. Paling banyak 32.768. Jika tidak diberi, router memakai 32.768 atau sebanyak yang mampu dibayar saldo Anda, mana yang lebih kecil. |
temperature, top_p, stop, seed, frequency_penalty, presence_penalty | Passed on as usual.Diteruskan seperti biasa. |
tools, tool_choice, parallel_tool_calls, response_format | See Tools and JSON.Lihat Tool dan JSON. |
reasoning_budget | For a model that thinks before it answers: the most tokens it may spend thinking. A small number makes answers faster and cheaper. Thinking tokens are billed as output.Untuk model yang berpikir sebelum menjawab: jumlah token paling banyak untuk berpikir. Angka kecil membuat jawaban lebih cepat dan murah. Token berpikir ditagih sebagai output. |
n | Only 1.Hanya 1. |
Other fields are ignored, not refused, so a library that sends extras still works.
Bidang lain diabaikan, bukan ditolak, jadi pustaka yang mengirim tambahan tetap bekerja.
The answerJawabannya
{
"id": "chatcmpl-1a2b3c...",
"object": "chat.completion",
"created": 1763500000,
"model": "myriaxon-large",
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! I am Myriaxon-Large ..." }, "finish_reason": "stop" }],
"usage": { "prompt_tokens": 18, "completion_tokens": 42, "total_tokens": 60, "prompt_tokens_details": { "cached_tokens": 0 } }
}finish_reason is stop (finished), length (the reply hit max_tokens) or tool_calls. Two headers tell you what the call cost: x-myriaxon-cost-usd and x-myriaxon-balance-usd (the balance after it, when it can be known); x-myriaxon-request-id identifies the call if you ever ask about it.
finish_reason bernilai stop (selesai), length (jawaban mencapai max_tokens), atau tool_calls. Dua header memberi tahu biaya panggilan: x-myriaxon-cost-usd dan x-myriaxon-balance-usd (saldo setelahnya, bila dapat diketahui); x-myriaxon-request-id mengenali panggilan bila Anda perlu menanyakannya.
A reply that takes minutes is fine: without stream the router waits for the whole reply for you. For long replies, stream: true is still better: you see words at once and your own connection never sits idle.
Jawaban yang memakan waktu beberapa menit tidak masalah: tanpa stream router menunggu seluruh jawaban untuk Anda. Untuk jawaban panjang, stream: true tetap lebih baik: kata-kata langsung muncul dan koneksi Anda tidak menganggur.
5. Streaming5. Streaming
With "stream": true the answer arrives as server-sent events: lines that start with data:, each a JSON chat.completion.chunk, ending with data: [DONE]. The last chunk before it carries usage. Every client library reads this for you.
Dengan "stream": true jawaban datang sebagai server-sent events: baris berawalan data:, masing-masing JSON chat.completion.chunk, diakhiri data: [DONE]. Potongan terakhir sebelumnya memuat usage. Setiap pustaka klien membacanya untuk Anda.
stream = client.chat.completions.create(
model="myriaxon-medium",
messages=[{"role": "user", "content": "Write a haiku about rain."}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)If you close the connection in the middle, you are billed for what had been sent, estimated, and the rest of what was held back is returned.
Jika Anda menutup koneksi di tengah jalan, Anda ditagih untuk yang sudah terkirim (perkiraan), dan sisa yang ditahan dikembalikan.
6. Tools and JSON6. Tool dan JSON
Function calling works as in OpenAI's API: describe functions in tools, the model answers with tool_calls, you run them and send the results back as role: "tool" messages. response_format ({"type": "json_object"}) asks for JSON. See Connect your own agent for a complete loop.
Function calling bekerja seperti API OpenAI: deskripsikan fungsi di tools, model menjawab dengan tool_calls, Anda menjalankannya lalu mengirim hasilnya kembali sebagai pesan role: "tool". response_format ({"type": "json_object"}) meminta JSON. Lihat Hubungkan agen Anda untuk loop lengkap.
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "The weather in a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]},
},
}]
reply = client.chat.completions.create(model="myriaxon-large", messages=messages, tools=tools)
call = reply.choices[0].message.tool_calls[0] # call.function.name, call.function.arguments (a JSON string)Check the arguments before you act on them: a model can send an incomplete or invalid JSON string, and what it reads (web pages, files, emails) can try to steer it. Treat tool results as data, never as instructions.
Periksa argumen sebelum bertindak: model dapat mengirim string JSON yang tak lengkap atau tidak valid, dan apa yang dibacanya (halaman web, berkas, email) dapat mencoba mengarahkannya. Perlakukan hasil tool sebagai data, bukan perintah.
7. Pictures7. Gambar
Every Myriaxon model accepts pictures in a user message, in the OpenAI form: a content part of type image_url, with the picture inline as a data address or as an https:// address. PNG, JPEG, GIF and WebP. Up to 6 pictures in a request.
- Myriaxon-Medium sees the picture itself.
- Myriaxon-Large and Myriaxon-Small do not see pictures, so the router has Medium's vision read the picture first (what it shows, every word of text in it, tables, charts), and gives your model that reading in place of the picture. Your model still answers, with its own style and tools. The reading is billed at Medium's prices (a picture counts as about 1,500 tokens in, and the description as output), on top of the call. The answer's usage includes both.
Setiap model Myriaxon menerima gambar dalam pesan user, dalam bentuk OpenAI: bagian konten bertipe image_url, dengan gambar inline sebagai alamat data atau alamat https://. PNG, JPEG, GIF, dan WebP. Hingga 6 gambar per permintaan.
- Myriaxon-Medium melihat gambar sendiri.
- Myriaxon-Large dan Myriaxon-Small tidak melihat gambar, jadi router meminta penglihatan Medium membaca gambar lebih dulu (apa yang tampak, setiap kata teks di dalamnya, tabel, grafik), lalu memberikan hasil bacaan itu kepada model Anda sebagai pengganti gambar. Model Anda tetap yang menjawab, dengan gaya dan tool-nya sendiri. Pembacaan ditagih dengan harga Medium (satu gambar dihitung sekitar 1.500 token input, dan deskripsinya sebagai output), di atas biaya panggilan. Usage pada jawaban mencakup keduanya.
import base64
picture = base64.b64encode(open("receipt.png", "rb").read()).decode()
reply = client.chat.completions.create(
model="myriaxon-medium",
messages=[{"role": "user", "content": [
{"type": "text", "text": "What is the total on this invoice?"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{picture}"}},
]}],
)Keep pictures small: a request may be up to about 4 MB, and shrinking a picture to 1,500 pixels on its longest side loses nothing a model can use. Other addresses (http, file) are refused.
Jaga ukuran gambar tetap kecil: satu permintaan paling besar sekitar 4 MB, dan mengecilkan gambar hingga 1.500 piksel pada sisi terpanjang tidak menghilangkan apa pun yang berguna bagi model. Alamat lain (http, file) ditolak.
8. Who the models say they are8. Identitas model
Every conversation starts, behind the scenes, with a short introduction that tells the model its name: Myriaxon-Large, Myriaxon-Medium or Myriaxon-Small, a model of the Myriaxon router. Asked who it is, a model answers with that name. It is put into your own system message, before your text, so your instructions still apply. It covers only how the model describes itself: you can discuss other models and companies with it normally, and it does not make the model invent an origin: asked who trained it, it says it has no reliable details about the technology underneath.
The introduction is not charged to you. The name in model in every answer is the router's name, never anything else.
Setiap percakapan dimulai, di balik layar, dengan pengantar singkat yang memberi tahu model namanya: Myriaxon-Large, Myriaxon-Medium, atau Myriaxon-Small, model dari Myriaxon router. Ditanya siapa dirinya, model menjawab dengan nama itu. Pengantar itu disisipkan ke dalam pesan system Anda, sebelum teks Anda, sehingga instruksi Anda tetap berlaku. Ia hanya mengatur cara model menggambarkan dirinya: Anda tetap bisa membahas model dan perusahaan lain dengannya, dan ia tidak membuat model mengarang asal-usul: jika ditanya siapa yang melatihnya, ia menjawab tidak punya rincian yang andal tentang teknologi di bawahnya.
Pengantar itu tidak ditagihkan kepada Anda. Nilai model pada setiap jawaban adalah nama router, tak pernah yang lain.
9. Balance and billing9. Saldo dan tagihan
- The balance is in US$ and is spent per call: (input tokens - cached) x input price + cached tokens x cached price + output tokens x output price, per million tokens, rounded up to a millionth of a dollar. Output includes the tokens a model spends thinking.
- Before a call starts, the router holds back the most it could cost (your prompt plus the longest reply it will allow); when the call ends the difference comes back. So your balance can never go below zero, even with many calls at the same moment. If your balance cannot cover the call, you get
402at once and nothing is spent. - A reply is limited to what your balance can pay for, so a small balance gives shorter maximum replies, not a surprise.
- A call that fails costs nothing. If the model is down, busy or times out, you get a plain error and your balance does not move.
- Check the balance any time:
GET /v1/mewith your key, or your router page.
- Saldo dalam US$ dan dipakai per panggilan: (token input - ter-cache) x harga input + token ter-cache x harga cache + token output x harga output, per sejuta token, dibulatkan ke atas hingga sepersejuta dolar. Output termasuk token yang dipakai model untuk berpikir.
- Sebelum panggilan dimulai, router menahan biaya terbesar yang mungkin (prompt Anda ditambah jawaban terpanjang yang diizinkan); saat panggilan selesai, selisihnya dikembalikan. Jadi saldo Anda tak akan pernah di bawah nol, bahkan dengan banyak panggilan bersamaan. Jika saldo tidak cukup untuk panggilan, Anda langsung mendapat
402dan tidak ada yang terpakai. - Jawaban dibatasi sebanyak yang mampu dibayar saldo Anda, jadi saldo kecil memberi jawaban maksimum lebih pendek, bukan kejutan.
- Panggilan yang gagal tidak dikenai biaya. Jika model mati, sibuk, atau kehabisan waktu, Anda mendapat error biasa dan saldo tidak berubah.
- Cek saldo kapan saja:
GET /v1/medengan kunci Anda, atau halaman router Anda.
curl https://api.myriaxon.com/v1/me -H "Authorization: Bearer $MYRIAXON_API_KEY"
# {"object":"account","status":"active","balance_usd":4.213355,"topped_up_usd":6.060606,"spent_usd":1.847251, ...}10. Topping up10. Isi saldo
There is no card payment: you pay by bank transfer and the owner approves each top-up by hand.
- On your router page, choose an amount in rupiah (a minimum applies) and press Get the transfer details.
- You are given an exact amount to transfer: your amount plus a small code (1 to 999 rupiah). The code is what lets the owner find your payment on the bank statement when several people pay the same amount. It is not credited. Transfer exactly that amount to the account shown on the page.
- Upload the receipt (a screenshot or a PDF) on the same page. A request is valid for 48 hours after you make it.
- The owner compares the receipt with the bank statement and approves. Your balance is credited at once, in US$: the rupiah received divided by the exchange rate shown on the page at that moment. You can see the credit, and the rate used, in your top-up history. If something does not match, the owner rejects it and writes why, and you can make a new request.
Approval is by a person, so it can take a few hours; it is not instant. Nothing is credited until it is approved.
Tidak ada pembayaran kartu: Anda membayar lewat transfer bank dan pemilik menyetujui setiap isi saldo secara manual.
- Di halaman router Anda, pilih jumlah dalam rupiah (ada batas minimum) lalu tekan Get the transfer details.
- Anda diberi jumlah persis yang harus ditransfer: jumlah Anda ditambah kode kecil (1 sampai 999 rupiah). Kode itu yang memungkinkan pemilik menemukan pembayaran Anda di mutasi bank ketika beberapa orang membayar jumlah yang sama. Kode tidak dikreditkan. Transfer persis jumlah itu ke rekening yang tertera di halaman.
- Unggah bukti transfer (tangkapan layar atau PDF) di halaman yang sama. Permintaan berlaku 48 jam sejak dibuat.
- Pemilik mencocokkan bukti dengan mutasi bank lalu menyetujui. Saldo Anda langsung dikreditkan dalam US$: rupiah yang diterima dibagi kurs yang tampil di halaman pada saat itu. Kredit dan kurs yang dipakai terlihat di riwayat isi saldo Anda. Jika ada yang tidak cocok, pemilik menolak dan menuliskan alasannya, dan Anda bisa membuat permintaan baru.
Persetujuan dilakukan oleh orang, jadi bisa memakan beberapa jam; tidak instan. Tidak ada yang dikreditkan sebelum disetujui.
11. Errors and limits11. Error dan batas
Errors use OpenAI's shape, so client libraries handle them: {"error": {"message": "...", "type": "...", "code": "..."}}. The message says what to do.
Error memakai bentuk OpenAI, jadi pustaka klien menanganinya: {"error": {"message": "...", "type": "...", "code": "..."}}. Pesannya menjelaskan apa yang harus dilakukan.
| HTTP | code | What it meansArtinya |
|---|---|---|
| 400 | invalid_json, invalid_messages, invalid_image, too_many_images, n_not_supported, invalid_request | The request is wrong; the message says how. Not charged.Permintaan salah; pesan menjelaskan caranya. Tidak ditagih. |
| 401 | invalid_api_key | No key, a key that is not ours, a key that does not exist, or one that was revoked.Tanpa kunci, kunci bukan milik kami, tidak ada, atau sudah dicabut. |
| 402 | insufficient_balance | The balance cannot cover this call. The message gives your balance, what the call needs at least, and where to top up.Saldo tidak cukup untuk panggilan ini. Pesan menyebut saldo Anda, kebutuhan minimum panggilan, dan tempat mengisi saldo. |
| 403 | account_suspended | The account is suspended. Contact the operator.Akun ditangguhkan. Hubungi operator. |
| 404 | model_not_found | Unknown model; the message lists the right ids.Model tak dikenal; pesan mencantumkan id yang benar. |
| 413 | request_too_large | The request is over about 4 MB.Permintaan melebihi sekitar 4 MB. |
| 429 | rate_limit_exceeded, model_busy | Too many calls (60 a minute per account), or the model is busy. Wait the number of seconds in retry-after and try again. Not charged.Terlalu banyak panggilan (60 per menit per akun), atau model sibuk. Tunggu sebanyak detik pada retry-after lalu coba lagi. Tidak ditagih. |
| 502 / 504 | model_unavailable, model_timeout | The model failed or took too long. Not charged. Try again; for long replies use stream: true.Model gagal atau terlalu lama. Tidak ditagih. Coba lagi; untuk jawaban panjang pakai stream: true. |
Good practice: retry on 429, 502 and 504 with a short, growing pause (1 s, 2 s, 4 s) and give up after a few tries. Do not retry 400, 401, 402 or 403 without changing something.
Praktik baik: ulangi untuk 429, 502, dan 504 dengan jeda singkat yang bertambah (1 dtk, 2 dtk, 4 dtk) dan menyerah setelah beberapa kali. Jangan ulangi 400, 401, 402, atau 403 tanpa mengubah sesuatu.
| LimitBatas | ValueNilai |
|---|---|
| CallsPanggilan | 60 / minute per accountmenit per akun |
| Longest replyJawaban terpanjang | 32,768 tokens |
| Request sizeUkuran permintaan | ~4 MB |
| Pictures per requestGambar per permintaan | 6 |
| Keys per accountKunci per akun | 5 |
12. Connect your tools12. Hubungkan alat Anda
Any program, library or coding tool that has an "OpenAI-compatible" or "custom base URL" setting works with the same three values:
Program, pustaka, atau alat coding apa pun yang punya pengaturan "OpenAI-compatible" atau "custom base URL" bekerja dengan tiga nilai yang sama:
| Base URL | https://api.myriaxon.com/v1 |
| API key | myx_sk_... |
| Model | myriaxon-large (oratau myriaxon-medium, myriaxon-small) |
Environment variables many tools readVariabel lingkungan yang dibaca banyak alat
export OPENAI_BASE_URL="https://api.myriaxon.com/v1"
export OPENAI_API_KEY="myx_sk_..."LangChain (Python)
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="myriaxon-large", base_url="https://api.myriaxon.com/v1", api_key="myx_sk_...")
print(llm.invoke("Hello!").content)LlamaIndex
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(model="myriaxon-large", api_base="https://api.myriaxon.com/v1", api_key="myx_sk_...", is_chat_model=True)Vercel AI SDK
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const myriaxon = createOpenAICompatible({ name: "myriaxon", baseURL: "https://api.myriaxon.com/v1", apiKey: process.env.MYRIAXON_API_KEY });
const { text } = await generateText({ model: myriaxon("myriaxon-large"), prompt: "Hello!" });Coding tools and chat apps (editors with an AI assistant, command-line coding agents, self-hosted chat interfaces): in their settings choose the provider kind "OpenAI-compatible" or "custom", and paste the three values above. If a tool asks for a context length, 128,000 is safe. If a tool insists on a model name from its own list, use its "custom model" field.
Alat coding dan aplikasi chat (editor dengan asisten AI, agen coding baris perintah, antarmuka chat yang di-host sendiri): di pengaturannya pilih jenis penyedia "OpenAI-compatible" atau "custom", lalu tempel tiga nilai di atas. Jika alat menanyakan panjang konteks, 128.000 aman. Jika alat memaksa nama model dari daftarnya sendiri, pakai kolom "custom model".
13. Connect your own agent13. Hubungkan agen Anda
An agent is a loop: the model asks for a tool, your code runs it, the result goes back, until the model answers. This one is complete and runs as it is (Python, with the openai package). It has two tools, limits itself to ten steps, and never runs what it did not recognise.
Agen adalah sebuah loop: model meminta sebuah tool, kode Anda menjalankannya, hasilnya dikirim kembali, sampai model menjawab. Contoh ini lengkap dan dapat dijalankan apa adanya (Python, dengan paket openai). Ada dua tool, dibatasi sepuluh langkah, dan tak pernah menjalankan yang tidak dikenalinya.
import json, os, pathlib
from openai import OpenAI
client = OpenAI(base_url="https://api.myriaxon.com/v1", api_key=os.environ["MYRIAXON_API_KEY"])
MODEL = "myriaxon-large"
ROOT = pathlib.Path(".").resolve()
def safe(path): # stay inside the project folder
p = (ROOT / path).resolve()
if ROOT not in p.parents and p != ROOT:
raise ValueError("outside the folder")
return p
TOOLS = {
"list_files": lambda a: "\n".join(sorted(str(f.relative_to(ROOT)) for f in safe(a.get("path", ".")).rglob("*") if f.is_file()))[:4000],
"read_file": lambda a: safe(a["path"]).read_text()[:8000],
}
SPECS = [
{"type": "function", "function": {"name": "list_files", "description": "List the files under a folder",
"parameters": {"type": "object", "properties": {"path": {"type": "string"}}}}},
{"type": "function", "function": {"name": "read_file", "description": "Read a text file",
"parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}},
]
messages = [
{"role": "system", "content": "You are a careful coding assistant. Use the tools to look before you answer."},
{"role": "user", "content": "What does this project do? Read what you need."},
]
for step in range(10): # a hard limit on steps
reply = client.chat.completions.create(model=MODEL, messages=messages, tools=SPECS)
msg = reply.choices[0].message
messages.append(msg)
if not msg.tool_calls:
print(msg.content); break
for call in msg.tool_calls:
try:
result = TOOLS[call.function.name](json.loads(call.function.arguments or "{}"))
except Exception as e: # tell the model what went wrong, do not crash
result = f"Error: {e}"
messages.append({"role": "tool", "tool_call_id": call.id, "content": str(result)})
else:
print("Stopped after 10 steps.")What to add for a real agent:
- Ask before you change anything. Reading is safe; writing, deleting and running commands should wait for a person, or for a rule you wrote.
- Budget. Count
usagein each answer, or readx-myriaxon-balance-usd, and stop when you are over what you decided to spend. A402means the balance is gone. - Keep the conversation short. Long conversations cost more at every step; the cached price helps when the start of the conversation does not change between calls, so keep your system message and tools stable and put what changes at the end.
- Pictures: pass them as in Pictures; an agent that takes screenshots can use any Myriaxon model.
Yang perlu ditambahkan untuk agen sungguhan:
- Tanya sebelum mengubah apa pun. Membaca aman; menulis, menghapus, dan menjalankan perintah sebaiknya menunggu orang, atau aturan yang Anda tulis.
- Anggaran. Hitung
usagepada tiap jawaban, atau bacax-myriaxon-balance-usd, lalu berhenti saat melewati yang Anda putuskan.402berarti saldo habis. - Jaga percakapan tetap pendek. Percakapan panjang lebih mahal di setiap langkah; harga cache membantu bila awal percakapan tidak berubah antar-panggilan, jadi jaga pesan system dan tool tetap stabil dan taruh yang berubah di bagian akhir.
- Gambar: kirim seperti di Gambar; agen yang mengambil tangkapan layar dapat memakai model Myriaxon mana pun.
14. The Myriaxon harness14. Harness Myriaxon
Myriaxon also has its own agent, with files, tools, persistent agents and an administrator's controls (the guide). Your router balance powers it too:
- On your router page press Open the harness with this balance. It makes a key for you (named "Myriaxon app", stored encrypted, never shown to you or to the page), selects Myriaxon-Large, and opens the workspace.
- Choose another model in the model list any time: Myriaxon-Medium for pictures and everyday work, Myriaxon-Small for cheap, fast jobs.
- Every call the agent makes is paid from the same balance. Your organisation's own limits (steps, tokens, dollars a day) still apply on top.
- The laptop app and the persistent agents (Loci) use the same "Myriaxon" key, so they spend the same balance.
If you revoke the "Myriaxon app" key on the router page, the harness stops working; press the button again for a new one.
Myriaxon juga punya agen sendiri, dengan berkas, tool, agen persisten, dan kendali administrator (panduan). Saldo router Anda juga menjalankannya:
- Di halaman router Anda tekan Open the harness with this balance. Tombol itu membuatkan kunci (bernama "Myriaxon app", disimpan terenkripsi, tak pernah ditampilkan kepada Anda atau halaman), memilih Myriaxon-Large, dan membuka ruang kerja.
- Pilih model lain kapan saja di daftar model: Myriaxon-Medium untuk gambar dan pekerjaan sehari-hari, Myriaxon-Small untuk tugas murah dan cepat.
- Setiap panggilan agen dibayar dari saldo yang sama. Batas organisasi Anda (langkah, token, dolar per hari) tetap berlaku di atasnya.
- Aplikasi laptop dan agen persisten (Loci) memakai kunci "Myriaxon" yang sama, jadi memakai saldo yang sama.
Jika Anda mencabut kunci "Myriaxon app" di halaman router, harness berhenti bekerja; tekan tombolnya lagi untuk kunci baru.
15. Privacy and safety15. Privasi dan keamanan
- What is kept: for each call, only numbers: which model, how many tokens in and out, what it cost, how long it took, whether it worked. Your prompts and the replies are not stored by the router, and are not in the audit log.
- Where your text goes: it is sent to the model's provider to be answered, and comes back to you. It is not used by the router for anything else.
- Keys are stored only as a fingerprint. The router's own keys for its providers are secrets of the service and never leave it.
- Receipts are kept only for the owner to check the payment: a rejected one is deleted at once, an approved one after 90 days, and they are never shown to other users.
- Do not send what you must not share with a service provider: passwords, other people's personal data without a basis, secrets.
- Yang disimpan: untuk tiap panggilan, hanya angka: model mana, berapa token masuk dan keluar, biayanya, berapa lama, berhasil atau tidak. Prompt dan jawaban Anda tidak disimpan oleh router, dan tidak ada di log audit.
- Ke mana teks Anda pergi: dikirim ke penyedia model untuk dijawab, lalu kembali kepada Anda. Router tidak memakainya untuk hal lain.
- Kunci hanya disimpan sebagai sidik jari. Kunci milik router untuk penyedianya adalah rahasia layanan dan tak pernah keluar darinya.
- Bukti transfer disimpan hanya agar pemilik dapat memeriksa pembayaran: yang ditolak dihapus langsung, yang disetujui setelah 90 hari, dan tak pernah ditampilkan kepada pengguna lain.
- Jangan kirim apa yang tak boleh dibagikan kepada penyedia layanan: kata sandi, data pribadi orang lain tanpa dasar, rahasia.
16. Questions16. Pertanyaan
Is it the same as OpenAI's API?
The chat completions API is compatible: requests, streaming, tools, JSON mode, pictures and errors have the same shape. It does not have every OpenAI endpoint (no embeddings, audio or image generation, no assistants API).
Which model is behind "Myriaxon-Large"?
The router chooses the models behind its names and may change them, or add a standby provider so that a call still works when the first one is down, while the name and the price stay the same. The names describe what you get (capable, balanced, fast), not a model brand. If you need to know the technology for a compliance reason, ask the operator.
Why did a call take long?
Models that think first can spend a minute or more on a hard question. Use stream: true to see it work, reasoning_budget to cap the thinking, or Myriaxon-Small for simple jobs.
Can I get a refund of my balance?
Ask the operator. Balance that is not spent stays on your account.
I paid but my balance did not change.
The owner approves by hand after checking the bank statement, so it can take a few hours. Check that you uploaded the receipt (the request must say "checking your receipt"), and that you transferred the exact amount shown. If it is rejected, the reason is written in your top-up history.
Where do I see what I spent?
On your router page: per day, per call, and the history of your balance.
Apakah sama dengan API OpenAI?
API chat completions kompatibel: permintaan, streaming, tool, mode JSON, gambar, dan error berbentuk sama. Tidak semua endpoint OpenAI tersedia (tanpa embeddings, audio, atau pembuatan gambar, tanpa assistants API).
Model apa di balik "Myriaxon-Large"?
Router memilih model di balik namanya dan dapat menggantinya, atau menambah penyedia cadangan agar panggilan tetap berjalan saat yang pertama mati, sementara nama dan harga tetap sama. Nama-nama itu menggambarkan yang Anda dapat (mampu, seimbang, cepat), bukan merek model. Jika Anda perlu mengetahui teknologinya karena alasan kepatuhan, tanyakan kepada operator.
Kenapa satu panggilan lama?
Model yang berpikir dulu dapat memakai semenit atau lebih untuk pertanyaan sulit. Pakai stream: true untuk melihatnya bekerja, reasoning_budget untuk membatasi pemikiran, atau Myriaxon-Small untuk tugas sederhana.
Bisakah saldo saya dikembalikan?
Tanyakan kepada operator. Saldo yang belum terpakai tetap di akun Anda.
Saya sudah transfer tetapi saldo belum berubah.
Pemilik menyetujui secara manual setelah memeriksa mutasi bank, jadi bisa beberapa jam. Pastikan Anda sudah mengunggah bukti (permintaan harus bertuliskan "checking your receipt"), dan Anda mentransfer jumlah persis yang tertera. Jika ditolak, alasannya tertulis di riwayat isi saldo Anda.
Di mana saya melihat pemakaian saya?
Di halaman router Anda: per hari, per panggilan, dan riwayat saldo.
Questions or problems: write to the operator of this site. Guide to the Myriaxon agent · Your routerPertanyaan atau masalah: hubungi operator situs ini. Panduan agen Myriaxon · Router Anda