Docs / Use your endpoint

Use your endpoint

Every deployment exposes an OpenAI-compatible API at https://<your-endpoint>/v1, authenticated with the API key from the deployment's Connect tab. Clients that support a compatible chat-completions endpoint can use it. Set the base URL, key and model ID, then test the features your application needs. The examples below use a placeholder endpoint and deepseek-v4-flash as the model id; your deployment's Connect tab shows the same snippets pre-filled with your real values.

A decision model such as Laya speaks a different API. Its snippets are on decision models.

Python (openai client)

pip install openai

from openai import OpenAI

client = OpenAI(
    base_url="https://abc12345.gw.llmhangar.com/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)

curl

curl https://abc12345.gw.llmhangar.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }'

JavaScript (openai package)

npm i openai

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://abc12345.gw.llmhangar.com/v1",
  apiKey: "YOUR_API_KEY",
});

const stream = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello" }],
  stream: true,
});

LangChain

pip install langchain-openai

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://abc12345.gw.llmhangar.com/v1",
    api_key="YOUR_API_KEY",
    model="deepseek-v4-flash",
)

print(llm.invoke("Hello").content)

Vercel AI SDK

npm i ai @ai-sdk/openai-compatible

import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";

const llmhangar = createOpenAICompatible({
  name: "llmhangar",
  baseURL: "https://abc12345.gw.llmhangar.com/v1",
  apiKey: "YOUR_API_KEY",
});

const { textStream } = streamText({
  model: llmhangar("deepseek-v4-flash"),
  prompt: "Hello",
});
for await (const chunk of textStream) process.stdout.write(chunk);

Cursor, Continue and Cline

Choose an OpenAI-compatible provider in your editor and enter the endpoint URL, API key and model ID from the Connect tab. Each editor has its own configuration format and support for custom endpoints.

Check the editor's routing and feature support before sending private code. A custom base URL does not establish that every editor feature connects directly to your server. For example, Cursor documents backend routing for requests using your own API key. Test a small coding task, including tool calls, before switching a team.

n8n, Zapier

# n8n: HTTP Request node (or Zapier: Webhooks by Zapier, POST)
Method:  POST
URL:     https://abc12345.gw.llmhangar.com/v1/chat/completions
Headers: Authorization: Bearer YOUR_API_KEY
         Content-Type: application/json
Body (JSON):
{
  "model": "deepseek-v4-flash",
  "messages": [{ "role": "user", "content": "{{ $json.prompt }}" }]
}

# The reply text is at: choices[0].message.content

Where your traffic goes

With the default node-local gateway, requests go directly to your instance. A private edge also runs in your account; the optional hosted edge proxies requests through infrastructure we operate. Review gateway placement and your client's routing before sending sensitive data.