Skip to main content

langchain-apertis

Native LangChain integration for the Apertis AI API. It uses the official apertis SDK directly and does not depend on langchain-openai.

Installation

pip install -U langchain-apertis
export APERTIS_API_KEY="..."

Chat completions

from langchain_apertis import ChatApertis

llm = ChatApertis(model="gpt-5.5", temperature=0)
print(llm.invoke("Explain what a native LangChain provider is.").text)

bind_tools() and with_structured_output() use Apertis' OpenAI-compatible tool format. A current Web Search model keeps its exact :web model suffix and exposes source records safely in response_metadata["apertis"]["web_sources"].

search = ChatApertis(
    model="gpt-5.5:web",
    web_results_count=5,
    web_content_length="medium",
)
response = search.invoke("What changed in this week's AI news?")
print(response.response_metadata["apertis"]["web_sources"])

Both current SDK Web Search stream-status shapes are exposed before model text. When the SDK supplies a status string, stream() and astream() retain it and set response_metadata["apertis"]["web_search_status"] to "in_progress".

Multimodal and audio chat

ChatApertis forwards LangChain's OpenAI-shaped image, input-audio, and video content parts directly to the official SDK. Model availability remains account- and model-dependent; the integration preserves the request contract rather than claiming a static catalog.

from langchain_core.messages import HumanMessage

vision = ChatApertis(model="gpt-5.5")
response = vision.invoke(
    [
        HumanMessage(
            content=[
                {"type": "text", "text": "Describe this image."},
                {"type": "image_url", "image_url": {"url": "https://example.com/cat.png"}},
            ]
        )
    ]
)

For audio-output requests, use the Apertis SDK-compatible modalities and audio parameters. Returned audio data is retained in response.additional_kwargs["audio"]; Web Search URL citations are retained in response.response_metadata["apertis"]["annotations"].

The current SDK's response_format and extra_body request fields are also direct ChatApertis constructor parameters.

Development verification

The public package metadata resolves published apertis>=0.3.0 from PyPI.

uv sync --group dev
uv run pytest -m "not integration"
uv build
docker build -t langchain-apertis-test -f Dockerfile.test .
docker run --rm --network none langchain-apertis-test

Publishing

After apertis>=0.3.0 is available on PyPI, configure PyPI Trusted Publishing for apertis-ai/langchain-apertis, .github/workflows/publish.yml, and the pypi environment. The manual Publish to PyPI workflow uploads only when dispatched with the publish confirmation value.

Release files for langchain-apertis 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-apertis 0.2.0
File Size Uploaded
langchain_apertis-0.2.0.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-apertis 0.2.0
File Interpreter ABI Platform
langchain_apertis-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.3 kB

Release files / langchain_apertis-0.2.0.tar.gz

Download URL langchain_apertis-0.2.0.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6274fac14bb72720ec26a5241068ff1a88a17f973679c08056508a109abf7ac0
BLAKE2b-256 checksum
How to use checksums
c8fcd6808caa3e558cf735e9b64b22975c1b14bd1336042cd30586519c24544b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release files / langchain_apertis-0.2.0-py3-none-any.whl

Download URL langchain_apertis-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf1747f937ff213e64902c3377a3d3ee567df4d5fa47ebff89bb48efc8edab52
BLAKE2b-256 checksum
How to use checksums
3db8595a3877927b14aaf025be80620562ba9f9bb802c5fcb40e5f8cdc9f75ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page