Skip to main content

Entry on Kitchen Python Library

PyPI - Downloads PyPI - Version

Official Python module for executing recipes on the Entry on Kitchen API. Supports both synchronous execution and real-time HTTP streaming.

Installation

pip install entry-on-kitchen

Quick Start

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

# Initialize the client with a static entry code
client = KitchenClient(
    authorization=EntryCodeAuthorization("your-auth-code-here"),
    entry_point="beta"  # Optional: use "" for production
)

# Synchronous execution
result = client.sync(
    recipe_id="your-recipe-id",
    entry_id="your-entry-id",
    body={"message": "Hello, Kitchen!"}
)

print(result)

KitchenClient Class

The KitchenClient class provides a simple interface for executing recipes.

Constructor

KitchenClient(authorization, entry_point="entry")

Parameters:

  • authorization (required): An EntryCodeAuthorization or BearerAuthorization capability
  • entry_point (str, optional): Entry point environment (e.g., "beta" for beta). Defaults to "entry"

Raises:

  • ValueError: If authorization is not provided or a credential is empty
  • TypeError: If authorization is not an authorization capability

Authorization capabilities

KitchenClient stores an authorization capability instead of a bearer token. Use EntryCodeAuthorization for a static entry code:

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

client = KitchenClient(
    authorization=EntryCodeAuthorization("your-entry-code"),
)

For a browser or service session that can refresh, use BearerAuthorization. Its callback is called synchronously immediately before every authenticated request and receives force_refresh=True only for the client's single bounded recovery attempt. The callback's return value is used as the raw Authorization header value; include Bearer yourself when your API expects that scheme.

from entry_on_kitchen import BearerAuthorization, KitchenClient

def get_token(force_refresh):
    # Call the owning auth client here; do not cache the returned token in
    # KitchenClient or in a long-lived request closure.
    return auth_client.get_token(force_refresh=force_refresh)

client = KitchenClient(authorization=BearerAuthorization(get_token))

Bearer requests are retried at most once after HTTP 401 or the Runner's exact Authorization expired or invalid response, provided no run identity or stream event has been emitted. Generic 403 responses and static entry-code requests are never retried.

Methods

sync(recipe_id, entry_id, body, use_kitchen_billing=False, llm_override=None, api_key_override=None, headers=None, thinking_override=None)

Execute a recipe synchronously and wait for the complete result.

Parameters:

  • recipe_id (str): The ID of the pipeline/recipe
  • entry_id (str): The ID of the entry block
  • body (dict or str): Request body data
  • use_kitchen_billing (bool, optional): Enable Kitchen billing
  • llm_override (str, optional): Override the LLM model (e.g., "gpt-4", "claude-3")
  • api_key_override (dict, optional): Override API keys for external services
  • thinking_override (str, optional): Standardized runtime thinking level: off, low, medium, high, xhigh, or max

Returns: Dictionary containing:

  • runId: The execution run ID
  • status: Execution status ("finished", "error", etc.)
  • result: The execution result (if successful)
  • error: Error message (if failed)
  • exitBlock: Exit block information

Example:

result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={
        "message": "Hello!",
        "provider": "google_genai",
        "model": "gemini-2.5-flash"
    }
)

if result["status"] == "finished":
    print("Success:", result["result"])
else:
    print("Error:", result["error"])

stream(recipe_id, entry_id, body, use_kitchen_billing=False, llm_override=None, api_key_override=None, headers=None, thinking_override=None)

Execute a recipe with real-time streaming. Yields events as they arrive.

Parameters:

  • recipe_id (str): The ID of the pipeline/recipe
  • entry_id (str): The ID of the entry block
  • body (dict or str): Request body data
  • use_kitchen_billing (bool, optional): Enable Kitchen billing
  • llm_override (str, optional): Override the LLM model (e.g., "gpt-4", "claude-3")
  • api_key_override (dict, optional): Override API keys for external services
  • thinking_override (str, optional): Standardized runtime thinking level: off, low, medium, high, xhigh, or max

Yields: Dictionary objects representing stream events with keys:

  • runId: The execution run ID
  • type: Event type (see types below)
  • time: Timestamp of the event
  • data: Event-specific data
  • socket: Socket ID (for "result" and "delta" events)
  • statusCode: HTTP status code

Event Types:

  • "progress": Execution progress updates
  • "result": Output data from blocks
  • "delta": Incremental content updates (for streaming LLM responses)
  • "info": Informational messages
  • "end": Final result (marks completion)

Example:

for event in client.stream(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Hello!"}
):
    event_type = event["type"]

    if event_type == "progress":
        data = event["data"]
        print(f"Progress: {data['blockPosition']}/{data['blocksToExitBlock']}")

    elif event_type == "result":
        socket = event["socket"]
        data = event["data"]
        print(f"Result from {socket}: {data}")

    elif event_type == "delta":
        socket = event["socket"]
        delta = event["data"]
        print(f"Delta update for {socket}: {delta}")

    elif event_type == "end":
        print("Complete!")
        print(f"Final result: {event['data']}")

stream_raw(recipe_id, entry_id, body, thinking_override=None)

Execute a recipe with streaming, yielding raw JSON strings. Useful for custom parsing.

Example:

for raw_json in client.stream_raw(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Hello!"},
    thinking_override="high",
):
    print(raw_json)

Complete Examples

Synchronous Execution

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

client = KitchenClient(
    authorization=EntryCodeAuthorization("your-auth-code"),
    entry_point="beta",
)

result = client.sync(
    recipe_id="my-recipe",
    entry_id="my-entry",
    body={"input": "value"}
)

print(f"Run ID: {result['runId']}")
print(f"Status: {result['status']}")
print(f"Result: {result.get('result')}")

Streaming with Progress Tracking

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"))

result_buffer = {}

for event in client.stream(
    recipe_id="my-recipe",
    entry_id="my-entry",
    body={"input": "value"}
):
    if event["type"] == "progress":
        # Show progress
        block = event["data"]["blockPosition"]
        total = event["data"]["blocksToExitBlock"]
        print(f"\rProgress: {block}/{total} blocks", end="", flush=True)

    elif event["type"] == "result":
        # Store results
        socket = event["socket"]
        result_buffer[socket] = event["data"]
        print(f"\nReceived result from {socket}")

    elif event["type"] == "end":
        print("\nExecution complete!")
        print(f"Final result: {event['data']}")

print("\nAll results:", result_buffer)

Streaming LLM Responses

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"))

full_response = ""

for event in client.stream(
    recipe_id="llm-recipe",
    entry_id="llm-entry",
    body={"prompt": "Tell me a story"}
):
    if event["type"] == "delta":
        # Delta updates contain incremental text
        for op in event["data"]:
            if op[0] == "i":  # Insert operation
                position, length, text = op[1], op[2], op[3]
                full_response += text
                print(text, end="", flush=True)

    elif event["type"] == "end":
        print("\n\nComplete!")

Environment Configuration

Production

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"), entry_point="")
# Uses: https://entry.on.kitchen

Beta

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"), entry_point="beta")
# Uses: https://beta.entry.on.kitchen

Custom Entry Point

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"), entry_point="custom")
# Uses: https://custom.entry.on.kitchen

Optional Features

Kitchen Billing

Enable Kitchen billing for your recipe execution:

result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Hello!"},
    use_kitchen_billing=True
)

LLM Model Override

Override the LLM model used in your recipe:

result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Write a poem"},
    llm_override="gpt-4"
)

# Or with streaming
for event in client.stream(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Write a poem"},
    llm_override="claude-3"
):
    # Handle events
    pass

Thinking Override

Set a standardized runtime thinking level for the selected model. Omit thinking_override to use the recipe/Chef default; auto is not sent as a runtime override.

result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Solve this carefully"},
    thinking_override="high",
)

Combining Options

You can use both options together:

result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body={"message": "Hello!"},
    use_kitchen_billing=True,
    llm_override="gpt-4"
)

Requirements

  • Python 3.7 or higher
  • requests library

Error Handling

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient
import requests

client = KitchenClient(authorization=EntryCodeAuthorization("your-auth-code"))

try:
    result = client.sync(
        recipe_id="recipe-123",
        entry_id="entry-456",
        body={"input": "value"}
    )
except requests.HTTPError as e:
    print(f"HTTP Error: {e}")
except ValueError as e:
    print(f"Value Error: {e}")
except Exception as e:
    print(f"Unexpected error: {e}")

Migration from v0.x

Version 0.4.0 is a breaking change from 0.3.x: pass an explicit authorization capability instead of auth_code. Here's how to migrate:

Old API (v0.x)

from entry_on_kitchen.Kitchen import EntryBlock

entry = EntryBlock(
    pipelineId="recipe-123",
    entryBlockId="entry-456",
    entryAuthCode="your-auth-code",
    entryPoint="beta"
)

# Synchronous
result = entry.runSync(input_data)

# Asynchronous with polling
result = await entry.runAsync(input_data)

New API (v0.4.0)

from entry_on_kitchen import EntryCodeAuthorization, KitchenClient

client = KitchenClient(
    authorization=EntryCodeAuthorization("your-auth-code"),
    entry_point="beta",
)

# Synchronous
result = client.sync(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body=input_data
)

# Streaming (replaces async/polling)
for event in client.stream(
    recipe_id="recipe-123",
    entry_id="entry-456",
    body=input_data
):
    handle_event(event)

License

Copyright © Endevre Technologies

Support

For issues and questions, contact: contact@endevre.com

Metadata

Release files for entry-on-kitchen 0.4.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 entry-on-kitchen 0.4.0
File Size Uploaded Provenance Actions
entry_on_kitchen-0.4.0.tar.gz 19.4 kB With provenance Details for entry_on_kitchen-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entry-on-kitchen 0.4.0
File Interpreter ABI Platform Actions
entry_on_kitchen-0.4.0-py3-none-any.whl Python 3 none any Details for entry_on_kitchen-0.4.0-py3-none-any.whl

Total release size: 33.3 kB

Release files / entry_on_kitchen-0.4.0.tar.gz

Download URL entry_on_kitchen-0.4.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f3e705c0674d6a0adb6902ab37efc6ef5563f561b64ebfb32a4f323382aa809e
BLAKE2b-256 checksum
How to use checksums
1f9d44bbe94874c9a4a5339d5e86e565749431b9c34abae8e37fab9f0ca26380
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 6, 2026.

Transparency log

Release files / entry_on_kitchen-0.4.0-py3-none-any.whl

Download URL entry_on_kitchen-0.4.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92d165101380ca7673e322c04a352888aaf6be0f4d64a12c6e9d456335736235
BLAKE2b-256 checksum
How to use checksums
e77eae3185bbafe5bc6bc52b73a03733ad510e76509dd7f201fff33c44600297
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 6, 2026.

Transparency log

Security for entry-on-kitchen 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for entry_on_kitchen-0.4.0.tar.gz

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 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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