A drop-in OpenAI-compatible API surface, served by LiteLLM. Point any existing SDK at the base URL below and begin.
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.
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 }'
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.
# 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)
Same client, different method. Returns one vector per input string, in the order given.
# 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
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.
# 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"])