SDKs & toolsUse with frameworks

Use with frameworks

Most application frameworks for language models can talk to any service that speaks the OpenAI-compatible chat completions format, as long as you can set a base URL and an API key. This page shows the settings for common frameworks and the checks to run before you rely on them.

The settings every framework needs

SettingValue
Base URLhttps://app.syntic.ai/v1
API keyA Syntic private key, from SYNTIC_API_KEY
ModelA Syntic model name, such as Amara S1.2

Examples

# pip install langchain-openai
import os
 
from langchain_openai import ChatOpenAI
 
llm = ChatOpenAI(
    model="Amara S1.2",
    base_url="https://app.syntic.ai/v1",
    api_key=os.environ["SYNTIC_API_KEY"],
    max_tokens=500,
)
print(llm.invoke("Give me two names for a bicycle repair café.").content)
 
for chunk in llm.stream("Describe a quiet harbour at dawn in two sentences."):
    print(chunk.content, end="", flush=True)

Checks before you rely on a framework

⚠️

Non-streaming calls must send "stream": false. The Syntic API streams when the field is missing. A framework that leaves the field out on its non-streaming path will receive an event stream it cannot parse. If a framework’s plain “generate” call fails with a parsing error, use its streaming call instead, or check whether it lets you add stream: false to the request body.

  1. Send one request with logging on and confirm the request body contains your Syntic model name and the stream setting you expect.
  2. Tell the framework the context window (262,144 tokens) where it asks for one, so its own history trimming works with the right number.
  3. Turn off features the API ignores. Framework options for temperature, seed, JSON mode or structured output are accepted and ignored by the API today; do not rely on them. For structured output, prefer the framework’s tool-calling path and validate the result.
  4. Check tool calling. Run one tool round trip; frameworks differ in how they format tool results, and the API needs each tool message to match its call’s id.
  5. Keep model names in configuration. Today unknown names fall back to the default model without an error, so a typo in framework config can go unnoticed. Not live yet — on develop: an unknown name returns 404 model_not_found, so a typo fails the first request.

Embeddings in frameworks

Frameworks often ask for an embedding model for retrieval. The Syntic embeddings endpoint is in preview (Embeddings); until it ships, configure the framework’s retriever with keyword search or with an embedding service you already use, and keep Syntic for the chat model.

Was this page helpful?