api.int2.net
v1 · OpenAI-Compatible
Inference endpoint

An LLM gateway, spoken simply.

A drop-in OpenAI-compatible API surface, served by LiteLLM. Point any existing SDK at the base URL below and begin.

Base URL https://api.int2.net/v1
01

From the shell

Send a chat completion with curl. Replace YOUR_API_KEY with the key you were issued, and your-model-name with one of the configured model aliases.

bash
curl https://api.int2.net/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "your-model-name",
    "messages": [
      {"role": "user", "content": "Hello, who are you?"}
    ],
    "temperature": 0.7
  }'
02

From Python

Chat and embeddings speak the OpenAI wire format, so the official openai SDK works with only a base_url override. Reranking follows the Cohere schema at /rerank.

A Chat completion

python
# pip install openai
from openai import OpenAI

client = OpenAI(
    base_url="https://api.int2.net/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="your-model-name",
    messages=[
        {"role": "user", "content": "Hello, who are you?"},
    ],
    temperature=0.7,
)

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

B Embeddings

Same client, different method. Returns one vector per input string, in the order given.

python
# Reuse the `client` from the chat example above.
resp = client.embeddings.create(
    model="your-embedding-model",
    input=["First document to embed.", "Second document."],
)

vectors = [d.embedding for d in resp.data]
print(len(vectors), len(vectors[0]))  # → e.g. 2 1024

C Reranker

Reranking is not part of the OpenAI SDK, so call the Cohere-compatible /rerank route directly. Note the path has no /v1 prefix. Response is a list of {index, relevance_score} sorted by score.

python
# pip install requests
import requests

resp = requests.post(
    "https://api.int2.net/rerank",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "your-reranker-model",
        "query": "What is the capital of Vietnam?",
        "documents": [
            "Hanoi is the capital of Vietnam.",
            "Tokyo is the capital of Japan.",
            "The Mekong flows through Vietnam.",
        ],
        "top_n": 3,
    },
    timeout=30,
)
resp.raise_for_status()

for r in resp.json()["results"]:
    print(r["index"], r["relevance_score"])