Official Interfaze SDK.
Project description
interfaze-python
The official Interfaze SDK for Python.
- Familiar chat surface -
chat.completions, streaming, tools, and structured output. - Typed Interfaze extras -
precontext(internal tool output),reasoning, andvcache(semantic-cache hit) on every response. - One-line task helpers - OCR, web search, scraping, speech-to-text, translation, object/GUI detection, forecasting.
- Multimodal inputs - images, PDFs, audio, video, and CSV, by URL or base64.
- Sync and async, fully typed.
Learn more
- interfaze.ai - dashboard and API keys.
- TypeScript / JavaScript SDK.
Capabilities
| Category | Capabilities |
|---|---|
| Chat & text | Chat completions, structured output, tools, reasoning |
| Vision & OCR | tasks.ocr - text and structured data from images and PDFs |
| Web | tasks.web_search, tasks.scrape |
| Audio | tasks.transcribe - speech-to-text |
| Detection | tasks.object_detection, tasks.gui_detection |
| Translation | tasks.translate |
| Forecasting | tasks.forecast - time-series prediction |
Install
pip install interfaze
Setup
Get an API key from the Interfaze dashboard, then:
from interfaze import Interfaze
interfaze = Interfaze(api_key="sk_...") # or set INTERFAZE_API_KEY and call Interfaze()
Async is identical via AsyncInterfaze (every call becomes await-able).
Usage
Chat completion:
res = interfaze.chat.completions.create(
messages=[{"role": "user", "content": "Write a haiku about deterministic AI."}],
)
print(res.choices[0].message.content)
print("cache hit:", res.vcache) # typed Interfaze extra
Task helpers - each returns the extracted result directly (a dict/list/str, not a completion):
interfaze.tasks.ocr("https://example.com/receipt.jpg")
interfaze.tasks.web_search("latest AI agent news")
interfaze.tasks.transcribe("https://example.com/audio.wav")
interfaze.tasks.scrape("https://example.com/product")
interfaze.tasks.translate("Hello", to="French")
interfaze.tasks.object_detection("https://example.com/photo.jpg")
interfaze.tasks.gui_detection("https://example.com/screenshot.png")
interfaze.tasks.forecast("https://example.com/series.csv", periods=30)
Structured output:
from interfaze import response_format
res = interfaze.chat.completions.create(
messages=[{"role": "user", "content": "Weather in Tokyo?"}],
response_format=response_format({
"type": "object",
"properties": {"city": {"type": "string"}, "temp_c": {"type": "number"}},
"required": ["city", "temp_c"],
}),
)
Streaming - .stream() yields typed events, with the inline <think>/<precontext> side-channels
stripped from the content events:
stream = interfaze.chat.completions.stream(
messages=[{"role": "user", "content": "Tell me a story."}],
)
for event in stream:
if event.type == "content.delta":
print(event.delta, end="")
final = stream.get_final_completion()
stream.text_deltas()yields clean visible text only;create(stream=True)returns the raw chunk iterator (side-channel tags not stripped).
Inputs
from interfaze import inputs
inputs.image("https://…/a.png") # image_url part
inputs.file("https://…/doc.pdf") # file part (pdf/csv/xml/json/text/video…)
inputs.audio("https://…/a.wav") # input_audio part
inputs.data_url(raw_bytes, "image/png") # base64 data URI
inputs.from_path("./doc.pdf") # read a local file
URLs and base64 both work; image/gif and image/avif are rejected client-side.
Interfaze extras
res.precontext- raw outputs of any internal tools that ran (OCR/web/scrape/STT/forecast/…).res.reasoning- reasoning text (withreasoning_effort="high"and no schema).res.vcache- whether the semantic cache was hit.reasoning_effortalso accepts"on"/"off"/"auto".- Guardrails:
create(guard=["S1", "S12_IMAGE"], …). - Control options:
Interfaze(show_additional_info=..., bypass_moe=..., bypass_cache=..., admin_key=...).
LangChain
pip install interfaze[langchain] adds a chat model pointed at Interfaze that keeps the extras a stock ChatOpenAI drops:
from interfaze.langchain import ChatInterfaze
llm = ChatInterfaze() # reads INTERFAZE_API_KEY
res = llm.invoke("Summarize the latest AI news")
print(res.response_metadata.get("precontext"), res.response_metadata.get("vcache"))
precontext/reasoning/vcache land on response_metadata, {"type": "video", ...} content blocks are accepted, and inline side-channel tags are stripped.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interfaze-1.0.1.tar.gz.
File metadata
- Download URL: interfaze-1.0.1.tar.gz
- Upload date:
- Size: 199.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64cf8298e38d448e7af6203da0e2917a876491910d53c4044278e427898f152f
|
|
| MD5 |
59f57a2d2befa4e420c01642c25e2531
|
|
| BLAKE2b-256 |
4518abe8197ff55f639da97651fab4674c1432764d8672f58461384770ec58e0
|
Provenance
The following attestation bundles were made for interfaze-1.0.1.tar.gz:
Publisher:
publish.yml on InterfazeAI/interfaze-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interfaze-1.0.1.tar.gz -
Subject digest:
64cf8298e38d448e7af6203da0e2917a876491910d53c4044278e427898f152f - Sigstore transparency entry: 2221223853
- Sigstore integration time:
-
Permalink:
InterfazeAI/interfaze-python@bc2434d1044d1867b21a46de53cc2a547d61e8fe -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/InterfazeAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc2434d1044d1867b21a46de53cc2a547d61e8fe -
Trigger Event:
release
-
Statement type:
File details
Details for the file interfaze-1.0.1-py3-none-any.whl.
File metadata
- Download URL: interfaze-1.0.1-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
685c6c793b5bf41b39c2f99d677a98b7b7255032bd34474dba2e91b65d209861
|
|
| MD5 |
fd6f9fc3e29541854606552ddeb3bb58
|
|
| BLAKE2b-256 |
81202a5edfdbb58139c57c76f4b085b4f19e1019a836d2c5211a0ccd42798883
|
Provenance
The following attestation bundles were made for interfaze-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on InterfazeAI/interfaze-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
interfaze-1.0.1-py3-none-any.whl -
Subject digest:
685c6c793b5bf41b39c2f99d677a98b7b7255032bd34474dba2e91b65d209861 - Sigstore transparency entry: 2221224203
- Sigstore integration time:
-
Permalink:
InterfazeAI/interfaze-python@bc2434d1044d1867b21a46de53cc2a547d61e8fe -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/InterfazeAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc2434d1044d1867b21a46de53cc2a547d61e8fe -
Trigger Event:
release
-
Statement type: