• v2.3 58e81299cc

    v2.3 Stable

    kerem released this 2026-02-03 13:55:28 +03:00 | 41 commits to main since this release

    📅 Originally published on GitHub: Tue, 03 Feb 2026 10:56:33 GMT
    🏷️ Git tag created: Tue, 03 Feb 2026 10:55:28 GMT

    Codex app now works with the Kiro Gateway. Main error messages are now clear and actionable instead of cryptic API codes.

    New Features

    • Codex app support - Added support for developer role used by OpenAI Codex app. Gateway now handles any unknown roles from OpenAI/Anthropic APIs by converting them to user role with proper message alternation (#64)
    • Enhanced error messages - Centralized error enhancement system that translates cryptic Kiro API errors into clear messages. Added support for CONTENT_LENGTH_EXCEEDS_THRESHOLD and MONTHLY_REQUEST_COUNT errors (#10, #62, #63)

    🐛 Bug Fixes

    • MCP images support - Fixed image preservation from MCP tool results. Images from tools like browsermcp are now correctly passed to Kiro API (#57)
    • Message structure validation - Fixed "Improperly formed request" when conversation starts with non-user message. Gateway now prepends synthetic user message when needed (#60)
    • Thinking mode language - Extended thinking mode should respect user's language preference

    📝 Documentation

    • Added CONTRIBUTING.md with project philosophy and code quality standards

    🙏 Contributors


    Full Changelog: https://github.com/jwadow/kiro-gateway/compare/v2.2...v2.3

    Downloads
  • v2.2 9c7933cf9f

    v2.2 Stable

    kerem released this 2026-01-30 15:09:43 +03:00 | 54 commits to main since this release

    📅 Originally published on GitHub: Fri, 30 Jan 2026 12:11:37 GMT
    🏷️ Git tag created: Fri, 30 Jan 2026 12:09:43 GMT

    A major reliability upgrade: intelligent truncation recovery automatically detects and handles API output limitations, Docker containerization enables production deployment with CI/CD, and critical fixes improve stability across regions and network conditions.

    New Features

    • Truncation Recovery System (#34, #42, #56) - Automatic detection and recovery from API output truncation. When Kiro API truncates responses due to size limits, the gateway now injects synthetic messages to help the model understand and adapt. Includes tool result truncation detection and content truncation detection with intelligent recovery strategies.

    • Docker Containerization (#55) - Full Docker support with optimized single-stage build, docker-compose configuration, health checks, and automated CI/CD pipeline. Supports all 4 authentication methods with volume mounts for credentials. Published to GitHub Container Registry (ghcr.io).

    • Model Alias System (#59) - Create custom model names to avoid namespace conflicts with IDE-specific models (e.g., Cursor's "auto" model). Supports user-friendly shortcuts and legacy model name compatibility.

    🐛 Bug Fixes

    • Regional Endpoint Fix (#58) - Fixed DNS resolution failures for non-us-east-1 regions (eu-central-1, etc.) by switching to universal q.{region}.amazonaws.com endpoint instead of region-specific codewhisperer.{region}.amazonaws.com.

    • CLOSE_WAIT Leak Fix (#54) - Resolved connection leak in streaming mode by using per-request HTTP clients instead of shared clients. Prevents orphaned connections when network interface changes (VPN disconnect/reconnect).

    • MCP Tool Results Bug (#46, #50) - Fixed handling of Pydantic TextContentBlock objects in tool results. MCP tool results now correctly display actual data instead of "(empty result)".

    • Fallback Models for DNS Failure (#25) - Added pre-configured model list as fallback when /ListAvailableModels API is unreachable due to DNS or network issues.

    Improvements

    • Network Error Classification (#53) - User-friendly error messages with troubleshooting steps for DNS failures, connection timeouts, SSL errors, and proxy issues. Replaces cryptic technical errors with actionable guidance.

    • Cursor IDE Compatibility (#49) - Support for Cursor's flat tool format, inverted model names (claude-4.5-opus-high), and improved tool_results handling. Orphaned tool_results are now converted to text instead of being stripped.

    • Removed Legacy Debug Settings - Cleaned up deprecated DEBUG_LAST_REQUEST option. Simplified configuration with DEBUG_MODE (off/errors/all).

    ⚙️ Configuration

    New environment variable:

    Variable Description Default Values
    TRUNCATION_RECOVERY Enable automatic truncation recovery true true, false

    🔄 Upgrade

    If you're still using the legacy DEBUG_LAST_REQUEST=true option from ancient versions, replace it with:

    • DEBUG_MODE=all - save logs for every request (same as old behavior)
    • DEBUG_MODE=errors - save logs only for failed requests (recommended for troubleshooting)

    📝 Documentation

    • AGENTS.md & Docker Guides - Added comprehensive AI agent guide and Docker deployment instructions to all translated READMEs.

    🙏 Contributors

    • @bhaskoro-muthohar - contributed root cause analysis and solution for MCP tool results bug (#46, #50)
    • @somehow-paul - contributed Cursor IDE compatibility design (#49)
    • @PAzter1101 - contributed Docker containerization with CI/CD (#55)
    • @saaj - contributed regional endpoint fix for eu-central-1 and other non-us-east-1 regions (#58)

    Full Changelog: https://github.com/jwadow/kiro-gateway/compare/v2.1...v2.2

    Downloads
  • v2.1 324073b73b

    v2.1 Stable

    kerem released this 2026-01-21 06:56:10 +03:00 | 75 commits to main since this release

    📅 Originally published on GitHub: Wed, 21 Jan 2026 04:00:21 GMT
    🏷️ Git tag created: Wed, 21 Jan 2026 03:56:10 GMT

    Major release adding Enterprise Kiro IDE support, VPN/proxy connectivity for restricted networks, and critical fixes for token persistence and tool validation.

    New Features

    • VPN/Proxy Support — Route Kiro API requests through HTTP/SOCKS5 proxy for users in China, corporate networks, or regions with AWS connectivity issues. Supports authentication and automatic URL normalization
    • Enterprise Kiro Support — Full support for corporate accounts with AWS IAM Identity Center (IdC) authentication, automatic device registration loading from ~/.aws/sso/cache/{clientIdHash}.json (#43, #45, #48)
    • Social Login Support — Support for Google, GitHub, Microsoft social logins in kiro-cli with automatic token persistence and priority-based key loading

    🐛 Bug Fixes

    • AWS SSO OIDC Token Format — Fixed token refresh to use correct JSON format with camelCase parameters instead of form-urlencoded (#43)
    • Token Persistence — Fixed refreshed AWS SSO OIDC tokens not being saved back to SQLite database, causing stale tokens after restart (#43)
    • Tool Name Validation — Added validation against Kiro API 64-character limit to prevent "Improperly formed request" errors from MCP servers with long tool names (#41)
    • Connection Leak — Added Connection: close header to streaming requests to prevent CLOSE_WAIT connection leak (#38)

    Improvements

    • JSON Truncation Diagnostics — Added diagnostic method to distinguish Kiro API truncation from malformed JSON in tool call arguments (#34)
    • GitHub Issues Link — Added quick access link to GitHub issues in startup banner for easier bug reporting
    • Enhanced Logging — Added debug log before sending requests to Kiro API for better troubleshooting

    📝 Documentation

    • README Translations — Added comprehensive README translations for 7 languages (ru, zh, es, id, pt, ja, ko)
    • Model Availability — Updated model list with tier-based availability notice and Claude Opus 4.5 free tier removal (January 17, 2026) (#39)
    • AWS SSO Configuration — Clarified AWS SSO credentials configuration and automatic device registration file loading (#43)

    ⚙️ Configuration

    Variable Default Description
    VPN_PROXY_URL (empty) VPN/Proxy URL for accessing Kiro API. Supports HTTP/SOCKS5 protocols with optional authentication. Examples: http://127.0.0.1:7890, socks5://127.0.0.1:1080, http://user:pass@proxy.com:8080

    🙏 Contributors


    Full Changelog: https://github.com/jwadow/kiro-gateway/compare/v2.0...v2.1

    Downloads
  • v2.0 f4ee183f32

    v2.0 Stable

    kerem released this 2026-01-11 07:11:10 +03:00 | 94 commits to main since this release

    📅 Originally published on GitHub: Sun, 11 Jan 2026 04:26:30 GMT
    🏷️ Git tag created: Sun, 11 Jan 2026 04:11:10 GMT

    A major architectural overhaul transforming Kiro Gateway from an OpenAI-only proxy into a universal API gateway supporting both OpenAI and Anthropic protocols. This release introduces a new unified core layer, dynamic model resolution, and significant reliability improvements for authentication and tool handling.

    💥 Breaking Changes

    Project Renamed: kiro-openai-gatewaykiro-gateway

    The project has been restructured to reflect its new multi-API nature:

    Before After
    from kiro_gateway import ... from kiro import ...
    kiro_gateway/routes.py kiro/routes_openai.py
    kiro_gateway/streaming.py kiro/streaming_openai.py
    kiro_gateway/converters.py kiro/converters_openai.py

    Migration: Update all imports from kiro_gateway to kiro. OpenAI-specific modules now have _openai suffix.

    Static Model Mapping Removed

    The hardcoded MODEL_MAPPING and AVAILABLE_MODELS in config.py have been replaced with dynamic model resolution. Models are now fetched from Kiro API at startup and cached.

    Impact: If you were relying on specific model aliases, they should still work due to the new normalization system.

    New Features

    Anthropic Messages API Support (#15)

    Full native support for the Anthropic Messages API at /v1/messages endpoint:

    • Complete protocol compatibility — Use the official Anthropic Python SDK or any Anthropic-compatible tool
    • Streaming support — Full SSE streaming with proper event types (message_start, content_block_delta, message_stop)
    • Tool calling — Native tool_use and tool_result content blocks
    • Extended thinking — Thinking content blocks for reasoning visibility
    import anthropic
    
    client = anthropic.Anthropic(
        api_key="your-proxy-key",
        base_url="http://localhost:8000"
    )
    
    response = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=1024,
        messages=[{"role": "user", "content": "Hello!"}]
    )
    

    Image Content Blocks (#30, #32)

    Vision support is here! Send images to Claude via both OpenAI and Anthropic formats:

    # Anthropic format
    {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": "..."}}
    
    # OpenAI format
    {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}}
    

    The gateway automatically handles format conversion and data URL prefix stripping for seamless integration with any client.

    Dynamic Model Resolution

    Smart model name handling that accepts any format and normalizes automatically:

    You Send Gateway Sends to Kiro
    claude-sonnet-4-5 claude-sonnet-4.5
    claude-sonnet-4.5 claude-sonnet-4.5
    claude-sonnet-4-5-20250929 claude-sonnet-4.5
    claude-3-7-sonnet claude-3.7-sonnet
    claude-3-7-sonnet-20250219 claude-3.7-sonnet

    Key principle: The gateway is a gateway, not a gatekeeper. Unknown models are passed through to Kiro API — let Kiro decide if they're valid.

    Configurable Server Host and Port (#19)

    New environment variables and CLI arguments for flexible deployment:

    # Environment variables
    SERVER_HOST=127.0.0.1 SERVER_PORT=9000 python main.py
    
    # CLI arguments (highest priority)
    python main.py --host 127.0.0.1 --port 9000
    python main.py -H 0.0.0.0 -p 8080
    

    Multi-API Core Architecture

    New unified core layer (streaming_core.py, converters_core.py) that:

    • Parses Kiro API responses into API-agnostic KiroEvent objects
    • Enables consistent behavior across OpenAI and Anthropic endpoints
    • Simplifies adding support for future API formats

    Shared HTTP Client with Connection Pooling (#24)

    Application-level shared httpx.AsyncClient for better resource management:

    • Reduced memory usage under concurrent load
    • Connection reuse across requests
    • Proper cleanup on shutdown

    🐛 Bug Fixes

    AWS SSO OIDC Authentication (#14, #16, #22)

    Multiple fixes for users authenticating via kiro-cli with AWS Builder ID:

    • Fixed scope parameter — No longer sent during token refresh per OAuth 2.0 RFC 6749 Section 6. AWS SSO OIDC was returning invalid_request when scope was included.
    • Detailed error logging — Now logs full error response from AWS SSO OIDC for easier debugging
    • SQLite credentials reload — Reloads credentials from SQLite before refresh attempt, catching updates from kiro-cli
    • Retry on 400 errors — If refresh fails with 400, reloads SQLite and retries once (handles kiro-cli memory-only token updates)
    • Separate SSO region — SSO region can now differ from API region for multi-region setups
    • Graceful degradation — If refresh fails but access token is still valid, continues using it with a warning

    Tool Content Handling (#20, #23)

    Fixes for clients like Cline/Roo that send tool-related content in various scenarios:

    • Strip tool content when no tools defined — Kiro API rejects toolResults without tools. Now automatically strips tool content from messages when request has no tools.
    • Placeholders for empty content — After stripping tool content, adds semantic placeholders ((tool use), (tool result)) to prevent empty message errors
    • Handle orphaned tool_results — When tool_result appears without preceding tool_use, strips it gracefully instead of failing

    Other Fixes

    • Suppress shutdown tracebacks — Clean exit on Ctrl+C without noisy CancelledError stack traces
    • Tool results format — Properly converts tool_use_id to toolUseId for Kiro API
    • System as content blocks — Support for system prompt as content blocks (enables prompt caching)

    Improvements

    • CLI improvements — Server port and host configurable via --port and --host arguments with priority: CLI > ENV > Default
    • Debug logging middleware — New DebugLoggerMiddleware captures validation errors (422) in debug logs (#31)
    • Reduced log spam — Consolidated merge_adjacent_messages logging into summary messages instead of per-message logs
    • Extended thinking content blocks — Anthropic endpoint now properly handles thinking blocks in responses

    📝 Documentation

    • Added architecture documentation for Anthropic API support (#15)
    • Clarified that git is optional, added ZIP download as alternative (#27)
    • Added donation section and GitHub funding configuration
    • Improved README with supported models section at the top
    • Cleaned up test documentation — removed verbose test descriptions from tests/README.md

    ⚙️ Configuration

    Variable Default Description
    SERVER_HOST 0.0.0.0 Server bind address. Use 127.0.0.1 for local-only access
    SERVER_PORT 8000 Server port number

    🙏 Contributors

    • @kilhyeonjun — SQLite credentials reload for containers (#22), thinking tags fix for toolResults (#23)
    • @cniu6 — Image content block support inspiration (#26)

    Full Changelog: https://github.com/jwadow/kiro-gateway/compare/v1.0.8...v2.0

    Downloads
  • v1.0.8 5c4fae1db9

    v1.0.8 Stable

    kerem released this 2026-01-04 06:51:32 +03:00 | 141 commits to main since this release

    📅 Originally published on GitHub: Sun, 04 Jan 2026 03:55:59 GMT
    🏷️ Git tag created: Sun, 04 Jan 2026 03:51:32 GMT

    This release adds full support for AWS SSO OIDC authentication (Builder ID) and introduces fake reasoning with extended thinking capabilities.

    New Features

    • Extended Thinking (Fake Reasoning): Implement fake reasoning with extended thinking support. The gateway can now inject thinking mode tags into prompts and parse <thinking> blocks from responses, enabling reasoning-like behavior with compatible models. Enabled by default. Includes system prompt legitimization to prevent models from treating thinking tags as prompt injection (#11)
    • AWS SSO OIDC Support: Full support for kiro-cli credentials using AWS IAM Identity Center (SSO) / Builder ID authentication. The gateway automatically reads credentials from kiro-cli's SQLite database, supporting both kirocli:* and codewhisperer:* key formats for compatibility with different kiro-cli versions. Builder ID users don't need to specify PROFILE_ARN (#12)

    🐛 Bug Fixes

    • User-Agent Format: Use original KiroIDE User-Agent format (KiroIDE-0.7.45-{fingerprint}) for better API compatibility

    ⚙️ Configuration

    AWS SSO OIDC (kiro-cli) Support:

    Variable Description Default
    KIRO_CLI_DB_FILE Path to kiro-cli SQLite database (e.g., ~/.local/share/kiro-cli/data.sqlite3) -
    KIRO_CREDS_FILE Path to AWS SSO cache JSON file (e.g., ~/.aws/sso/cache/*.json) -
    PROFILE_ARN AWS CodeWhisperer profile ARN. Not needed for AWS SSO OIDC (Builder ID) -

    Extended Thinking (Fake Reasoning):

    Variable Description Default
    FAKE_REASONING_ENABLED Enable fake reasoning mode with thinking tags injection true
    FAKE_REASONING_MAX_TOKENS Maximum tokens for thinking content 4000
    FAKE_REASONING_HANDLING How to handle thinking blocks: as_reasoning_content, remove, pass, strip_tags as_reasoning_content
    FAKE_REASONING_INITIAL_BUFFER_SIZE Buffer size for tag detection (characters). Lower = faster first token 20

    📝 Documentation

    • Code comments: Translating comments from Russian to English (only in modified files) for better international collaboration

    🙏 Contributors

    • Thanks to @uratmangun for testing, debugging, and providing the fix for AWS SSO OIDC support (#12)
    • Thanks to @JoeGrimes123 for suggesting the fake reasoning approach (#11)

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.7...v1.0.8

    Downloads
  • v1.0.7 a287c27665

    v1.0.7 Stable

    kerem released this 2025-12-18 23:13:12 +03:00 | 150 commits to main since this release

    📅 Originally published on GitHub: Thu, 18 Dec 2025 20:20:14 GMT
    🏷️ Git tag created: Thu, 18 Dec 2025 20:13:12 GMT

    Fixed silent streaming failures, added configurable streaming timeouts, and improved error diagnostics.

    New Features

    • Configurable streaming read timeout (#9): Added STREAMING_READ_TIMEOUT environment variable to control how long to wait between chunks during streaming (default: 300s)
    • Timeout configuration warning: Gateway now warns at startup if FIRST_TOKEN_TIMEOUT >= STREAMING_READ_TIMEOUT (suboptimal configuration)

    🐛 Bug Fixes

    • Silent streaming failures (#8): Fixed issue where streaming would "hang" without any error information in logs
      • Exceptions with empty str(e) (like httpx.RemoteProtocolError) now log exception type: [RuntimeError] actual message or [EmptyError] (empty message)
      • Exceptions are now properly propagated to routes.py instead of being silently swallowed
      • GeneratorExit (client disconnect) is handled separately as a normal situation, not an error
      • Response closing in finally block is now wrapped in try/except to prevent masking original errors

    Improvements

    • Timeout logging: Specific timeout types are now correctly identified and logged (ConnectTimeout, ReadTimeout, FirstTokenTimeout) for easier debugging
    • Improved timeout handling: Refactored timeout logic in http_client.py and streaming.py for better reliability
    • Manual test script: Enhanced manual_api_test.py with:
      • Support for loading credentials from KIRO_CREDS_FILE
      • Improved logging using loguru library
      • Better error messages and credential source tracking

    ⚙️ Configuration

    Variable Default Description
    STREAMING_READ_TIMEOUT 300 Maximum time (seconds) to wait for data between chunks during streaming

    📝 Documentation

    • Bug report template: Added GitHub Issue template for bug reports with structured fields for version, description, and debug logs
    • Code comments: Started translating comments from Russian to English (only in modified files) for better international collaboration

    🙏 Contributors

    • @Kartvya69 - STREAMING_READ_TIMEOUT feature (#9)

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.6...v1.0.7

    Downloads
  • v1.0.6 2aa4eaf032

    v1.0.6 Stable

    kerem released this 2025-12-17 20:47:33 +03:00 | 161 commits to main since this release

    📅 Originally published on GitHub: Wed, 17 Dec 2025 17:48:27 GMT
    🏷️ Git tag created: Wed, 17 Dec 2025 17:47:33 GMT

    Fixed 400 "Improperly formed request" error from Kiro API when using Cline.

    🐛 Bug Fixes

    • Fixed Cline compatibility issue (#7): Resolved error 400 "Improperly formed request" that occurred when Cline sent tool definitions with:
      • Empty required: [] arrays in JSON Schema
      • additionalProperties: false in JSON Schema
      • Empty description: "" for some tools (e.g., focus_chain)

    Improvements

    • JSON Schema sanitization: Added recursive cleaning of JSON Schema from fields not supported by Kiro API
    • Empty description handling: Tools with empty or whitespace-only descriptions now automatically receive a placeholder to satisfy Kiro API requirements

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.5...v1.0.6

    Downloads
  • v1.0.5 e687d2ac64

    v1.0.5 Stable

    kerem released this 2025-12-17 19:31:53 +03:00 | 162 commits to main since this release

    📅 Originally published on GitHub: Wed, 17 Dec 2025 16:37:42 GMT
    🏷️ Git tag created: Wed, 17 Dec 2025 16:31:53 GMT

    Added CORS support for browser-based clients and improved debug logging with application logs capture.

    New Features

    • CORS Middleware (#6): Full CORS support for browser-based clients and tools that send preflight OPTIONS requests. This fixes the 405 Method Not Allowed error for OPTIONS requests, enabling Obsidian plugins, browser extensions, and other web-based tools to work properly with the gateway.

    Improvements

    • Application Logs Capture: Debug logger now captures all application logs during request processing and saves them to app_logs.txt. In errors mode, logs are saved only for failed requests; in all mode, logs are saved for every request.

    • Uvicorn Logs Integration: Uvicorn access and error logs are now routed through loguru for consistent formatting.

    📝 Documentation

    • Updated README with DEBUG_MODE configuration details and new debug files description.

    ⚙️ Configuration

    Debug Files

    File Description
    request_body.json Incoming request from client (OpenAI format)
    kiro_request_body.json Request sent to Kiro API
    response_stream_raw.txt Raw stream from Kiro
    response_stream_modified.txt Transformed stream (OpenAI format)
    app_logs.txt Application logs for the request
    error_info.json Error details (only on errors)

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.4...v1.0.5

    Downloads
  • v1.0.4 d30c8bcc9f

    v1.0.4 Stable

    kerem released this 2025-12-17 08:01:44 +03:00 | 166 commits to main since this release

    📅 Originally published on GitHub: Wed, 17 Dec 2025 05:03:47 GMT
    🏷️ Git tag created: Wed, 17 Dec 2025 05:01:44 GMT

    Improved token counting accuracy with tiktoken fallback, fixed critical tool_calls merging bug for Codex CLI compatibility, and introduced a new flexible debug logging system.

    🐛 Bug Fixes

    • Fixed tool_calls loss during message merging (#5) — When multiple assistant messages with tool_calls were sent consecutively (common in Codex CLI), the second and subsequent tool_calls were being lost during merge. This caused Kiro API to return HTTP 400 with {"message":"Improperly formed request.","reason":null} (in this case: toolResult without corresponding toolUse). Now all tool_calls are properly preserved when merging adjacent assistant messages.

    New Features

    • New debug logging system with three modes:
      • DEBUG_MODE=off — Disabled (default)
      • DEBUG_MODE=errors — Save logs only for failed requests (4xx, 5xx). Data is buffered in memory and written to files only when an error occurs. Recommended for troubleshooting.
      • DEBUG_MODE=all — Save logs for every request (overwrites on each request)

    Improvements

    • Tiktoken fallback for prompt_tokens — When Kiro API doesn't return context_usage percentage, the gateway now uses tiktoken to calculate prompt_tokens from the original request messages and tools. This ensures accurate token usage reporting even when the API response is incomplete.

    • Improved token counting accuracy — The correction coefficient for Claude models is now applied more precisely: only to completion_tokens (output), not to prompt_tokens calculated via fallback.

    🗑️ Deprecated

    • DEBUG_LAST_REQUEST — This environment variable is deprecated and will be removed in future releases. Use DEBUG_MODE=errors or DEBUG_MODE=all instead. A warning will be shown at startup if you're still using the old option.

    ⚙️ Configuration

    Variable Values Default Description
    DEBUG_MODE off, errors, all off Debug logging mode

    🔄 Upgrade

    After downloading and extracting the new release, no additional steps are required. The new debug logging system is disabled by default.

    If you were using DEBUG_LAST_REQUEST=true, consider switching to DEBUG_MODE=errors for more efficient debugging (logs only failed requests).


    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.3...v1.0.4

    Downloads
  • v1.0.3 26df641ccd

    v1.0.3 Stable

    kerem released this 2025-12-16 21:46:22 +03:00 | 168 commits to main since this release

    📅 Originally published on GitHub: Tue, 16 Dec 2025 18:49:32 GMT
    🏷️ Git tag created: Tue, 16 Dec 2025 18:46:22 GMT

    Introduces accurate token counting for usage tracking and improves compatibility.

    New Features

    Added: Token counting with tiktoken for accurate usage tracking (#4)

    • New tokenizer.py module using OpenAI's tiktoken library (Rust-based, blazing fast)
    • Proper separation of prompt_tokens and completion_tokens in API responses
    • Claude correction factor (1.15x) for more accurate token estimation
    • Supports messages, tools, and multimodal content token counting
    • Graceful fallback to character-based estimation if tiktoken unavailable

    🐛 Bug Fixes

    Fixed: Structured JSON error responses from Kiro API

    • Error responses now return proper OpenAI-compatible JSON format instead of raw text
    • Includes error message, type, and status code for better debugging

    Fixed: Windows path compatibility for KIRO_CREDS_FILE

    • Paths with backslashes (e.g., D:\Projects\file.json) no longer break due to escape sequence processing
    • Added raw .env file reading to preserve Windows paths as-is

    Fixed: Cross-platform path normalization

    • KIRO_CREDS_FILE paths are now normalized for Windows/Linux/macOS compatibility

    Improvements

    Changed: Reduced default FIRST_TOKEN_TIMEOUT from 30s to 15s

    • Faster detection of stuck requests
    • More responsive retry behavior

    Changed: Centralized version constant

    • Version is now defined in single place (config.py) and imported elsewhere
    • Follows Single Source of Truth principle

    ⚙️ Configuration

    Updated default values:

    Variable Old Default New Default
    FIRST_TOKEN_TIMEOUT 30 15

    📦 Dependencies

    • Added tiktoken to requirements.txt for token counting

    🔄 Upgrade

    After downloading and extracting the new release, install new dependencies from the project folder:

    pip install -r requirements.txt
    

    Full Changelog: https://github.com/jwadow/kiro-openai-gateway/compare/v1.0.2...v1.0.3

    Downloads