For the complete documentation index, see llms.txt. This page is also available as Markdown.

Jev Router

This documentation is valid for the following list of our models:

  • typesafe/jev-router

Model Overview

Routes each chat request to a model picked for it. TypeSafe Jev judges how hard the request is, and the request goes to the cheapest model of the matching tier that can take it — light: GPT-6 Luna, DeepSeek V4.1 Flash, Gemini 3.1 Flash-Lite, Gemini 3.5 Flash-Lite; standard: GPT-6.1 Sol, Claude Sonnet 5.5; heavy: Claude Opus 5.5, GPT-6 Astra — falling back to a pricier one of the same tier if it fails. Light models do not reason unless you ask (reasoning_effort); standard and heavy ones may think before they answer. You pay the rate of the model that answers, named in meta.model (and the x-aimlapi-model header when not streaming), plus the judgement: one typesafe/jev decision at its catalogue price, listed as its own request in your usage (a turn that returns tool results goes back to the model that made the calls and needs none).

Context window is 1,050,000 tokens, with up to 384,000 tokens of output. The router accepts text, images, files and audio, and supports tools, parallel tool calls, streaming and structured output — the request shape is the same as any other chat model here.

Which models it routes to

Eight models, in three tiers. Within a tier they are comparable in quality and listed cheapest first: a request lands on the cheapest one that can take it, and falls back up in price, never down.

Tier
Models, cheapest first

light

openai/gpt-6-luna · deepseek/deepseek-v4.1-flash · google/gemini-3-1-flash-lite · google/gemini-3-5-flash-lite

standard

openai/gpt-6.1-sol · anthropic/claude-sonnet-5.5

heavy

anthropic/claude-opus-5.5 · openai/gpt-6-astra

TypeSafe Jev scores how much capability the request needs, on a scale from trivial to frontier. Below 1.5 the request goes to the light tier, below 2.5 to standard, otherwise to heavy; if the judgement does not come back, it defaults to standard. A candidate that cannot take the request — tools, images, a JSON schema, the context size — is skipped for the next one in its tier, and each request carries one fallback: the model chosen and the next eligible one.

Within a conversation the choice sticks for 30 minutes, so a follow-up does not get re-judged or jump models mid-thread.

The reasoning rule follows the tier. Light models are sent with their thinking off, so a small max_tokens is an answer rather than an empty, paid-for reasoning trace; standard and heavy ones may think before they answer. Either way, if you set reasoning_effort, reasoning or thinking, the router passes your value through untouched.

How to make the first API call

1️⃣ Required setup (don’t skip this) ▪ Create an account: Sign up on the AI/ML API website (if you don’t have one yet). ▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.

2️ Copy the code example At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

3️ Update the snippet for your use case ▪ Insert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key. ▪ Select a model: set the model field to typesafe/jev-router — the router picks the answering model for you. ▪ Provide input: fill in the request input field(s) shown in the example.

4️ (Optional) Tune the request See the API schema below for optional generation settings.

5️ Run your code Run the updated code in your development environment.

API Schema

post
Body
or
or
or
or
or
or
Responses
200

Successful response.

idstringRequired

A unique identifier for the chat completion.

Example: chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl
objectstring · enumRequired

The object type.

Example: chat.completionPossible values:
creatednumberRequired

The Unix timestamp (in seconds) of when the chat completion was created.

Example: 1762343744
modelstringRequired

The model that actually produced this completion — the one the router picked, not the router itself. Short form; meta.model carries its canonical id.

Example: gpt-6-luna
post/v1/chat/completions
curl --request POST \
  --url 'https://api.aimlapi.com/v1/chat/completions' \
  --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"model": "typesafe/jev-router", "messages": [{"role": "user", "content": "Hi! What do you think about mankind?"}]}'
200

Successful response.

{
  "id": "chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl",
  "object": "chat.completion",
  "created": 1762343744,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm just a program, so I don't have feelings, but I'm here and ready to help you. How can I assist you today?",
        "refusal": null,
        "annotations": null,
        "audio": null,
        "tool_calls": null
      },
      "finish_reason": "stop",
      "logprobs": null
    }
  ],
  "model": "gpt-6-luna",
  "usage": {
    "prompt_tokens": 137,
    "completion_tokens": 914,
    "total_tokens": 1051,
    "completion_tokens_details": null,
    "prompt_tokens_details": null
  },
  "meta": {
    "model": "openai/gpt-6-luna",
    "provider": "openai",
    "usage": {
      "credits_used": 120000,
      "usd_spent": 0.06
    }
  }
}

Code Example

Response

Finding out which model answered

The router never answers in its own name, so model at the top level is the model that was picked, in its short form — gpt-6-luna above, not typesafe/jev-router. The canonical id is in meta.model, and meta.usage is what that model charged you.

On non-streaming requests the same facts come back as response headers, which is the cheaper place to read them if you do not need the body:

Header
Example

x-aimlapi-model

openai/gpt-6-luna

x-aimlapi-provider

openai

x-aimlapi-credits-used

11

x-aimlapi-usd-spent

0.000005500

The same two questions, asked of the router, land on different models — this is the routing working as intended:

Because the answering model changes per request, so does the price. Budget against meta.usage.usd_spent per call rather than a fixed per-token rate, and expect a second, separate line in your usage logs for the typesafe/jev judgement that picked the model.

Last updated

Was this helpful?