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. Any client that can talk to the OpenAI API works by changing the base URL. 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.

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, Cline

// Cursor: Settings, Models, OpenAI API key + Base URL
//   Base URL: https://abc12345.gw.llmhangar.com/v1
//   API key:  YOUR_API_KEY
//   Model:    deepseek-v4-flash

// Continue / Cline: config.json, "models":
{
  "title": "deepseek-v4-flash",
  "provider": "openai",
  "model": "deepseek-v4-flash",
  "apiBase": "https://abc12345.gw.llmhangar.com/v1",
  "apiKey": "YOUR_API_KEY"
}

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

The endpoint is served directly from the instance in your cloud account. Prompts and responses travel between your client and your instance; they do not pass through LLM Hangar's servers.