TryLLM

Developers / Documentation

TryLLM API reference

Connect your editor or OpenAI SDK to TryLLM. Use your API key, the base URL below, and an exact model ID from the catalog.

API base URL

https://trychat.net/api/public/llm/v1

Quickstart

Three steps from sign-up to your first completion.

  1. 01

    Create a key

    Sign in, open the dashboard and create a key. It's shown in full once.

  2. 02

    Point at the base URL

    Swap OpenAI's base URL for the TryLLM endpoint in your tool or SDK.

  3. 03

    Send a request

    Use any OpenAI-shaped request. Streaming works the same way.

Your first request
curl https://trychat.net/api/public/llm/v1/chat/completions \
  -H "Authorization: Bearer $TRYLLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tryllm-chat",
    "messages": [{ "role": "user", "content": "Explain recursion in one line." }]
  }'

Authentication

Every request carries your key as a bearer token, exactly like OpenAI.

Base URL

https://trychat.net/api/public/llm/v1

Header

Authorization: Bearer sk-llm_…

Keys start with sk-llm_. Create and revoke them in your dashboard. A key is shown in full only once — store it in an environment variable, never in client-side code or a public repository.

Endpoints

MethodPathDescription
POST
/chat/completionsChat completion, streaming or not. Same body as OpenAI.
GET
/modelsList available model IDs. Requires your API key.

Code examples

The official OpenAI SDKs work unchanged.

python — openai
from openai import OpenAI

client = OpenAI(
    api_key="sk-llm_your_key",
    base_url="https://trychat.net/api/public/llm/v1",
)

response = client.chat.completions.create(
    model="tryllm-chat",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Streaming

Set stream: true and read server-sent chunks, exactly as with OpenAI.

node — streaming
const stream = await client.chat.completions.create({
  model: "tryllm-chat",
  messages: [{ role: "user", content: "Write a haiku about yellow." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Model catalog

Copy the exact model ID into your editor's custom model field or the model parameter in your request. Names are for display; IDs are what the API accepts.

0 available models

Loading model catalog…

Fetch available models
curl https://trychat.net/api/public/llm/v1/models \
  -H "Authorization: Bearer $TRYLLM_API_KEY"

Editors & apps

Two settings in each tool: the base URL and your key.

  1. 1Settings → Models → OpenAI API Key.
  2. 2Turn on "Override OpenAI Base URL" and paste https://trychat.net/api/public/llm/v1.
  3. 3Paste your sk-llm_ key, add tryllm-chat or tryllm-reasoner as a custom model, then verify.

Errors

Errors use the OpenAI error object, so existing error handling keeps working.

StatusCodeMeaning
401invalid_api_keyThe key is wrong, revoked or missing.
402insufficient_creditAllowance used up and no credit left on the account.
404model_not_foundThat model id does not exist.
429rate_limit_exceededToo many requests. Back off and retry, or upgrade.
500server_errorSomething failed on our side. Retry.
Error response
{
  "error": {
    "message": "Invalid API key.",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

Billing

Requests draw on your monthly allowance first, then on prepaid credit.

Usage is metered per token and shown per model in your dashboard. When the allowance runs out and no credit remains, requests fail with 402 insufficient_credit until you top up.