Liner API

Liner Model API

Generate text, understand images, and call functions with Liner Model API. Use the OpenAI SDK for Responses and Chat Completions, or the Anthropic SDK for Messages.

Send your first request

Create an API key on Liner Platform and set it as an environment variable.

Bash
export LINER_API_KEY="your-api-key"

Choose your language and the API your application uses. Responses and Chat Completions use the OpenAI SDK, and Messages uses the Anthropic SDK.

Bash
pip install openai
Python
import os
from openai import OpenAI
 
client = OpenAI(
    base_url="https://platform.liner.com/api/v1",
    api_key=os.environ["LINER_API_KEY"],
)
 
response = client.responses.create(
    model="liner-mark",
    input="Explain semantic search in three sentences.",
)
 
print(response.output_text)

Already using the OpenAI or Anthropic SDK? Keep it and update the base URL, API key, and model as shown above.

Stream a response

Set stream, or use the SDK's streaming helper, to receive text as it is generated. These examples use the client created above.

Python
stream = client.responses.create(
    model="liner-mark",
    input="Write a short poem about APIs.",
    stream=True,
)
 
for event in stream:
    if event.type == "response.output_text.delta":
        print(event.delta, end="", flush=True)

Model and pricing

The latest model is liner-mark-1.3. liner-mark always points to the newest version (currently liner-mark-1.3), and the response model field shows that version; liner-mark-latest is an alias with the same meaning. Usage is billed at the price of the resolved version. To keep behavior fixed in production, pin a version such as liner-mark-1.3. Earlier versions remain available for at least 3 months after a new version is released, and a shutdown is announced at least 60 days in advance. GET /v1/models lists the models you can call. liner-mark-1.3 supports a 1,000,000-token context window. The context window includes input, output, and tool definitions.

Models from OpenAI, Anthropic, Google, and other providers are also available with the same base URL and API key. Chat models work with Chat Completions, Responses, and Messages; batch models with the Batch API; decision models with the Decisions API. The charged amount is in the response usage.cost. See Models for the list and prices.

See Pricing for per-model prices and Rate limits for usage details.


Where to go next

Choose a reference for complete requests and examples of function calling, images, and structured outputs.

Need web information? Connect the Search API, or use the Search Agent API.