NAME
Langertha::Engine::AKIOpenAI - AKI.IO via OpenAI-compatible API
VERSION
version 0.503
SYNOPSIS
use Langertha::Engine::AKIOpenAI;
# Direct construction (use /v1 model names, NOT native AKI names)
my $aki = Langertha::Engine::AKIOpenAI->new(
api_key => $ENV{AKI_API_KEY},
model => 'gpt-oss-120b',
);
print $aki->simple_chat('Hello!');
# Streaming
$aki->simple_chat_stream(sub {
print shift->content;
}, 'Tell me about Perl');
# Via AKI's openai() method (uses default model)
use Langertha::Engine::AKI;
my $aki_native = Langertha::Engine::AKI->new(
api_key => $ENV{AKI_API_KEY},
model => 'llama3_8b_chat',
);
my $oai = $aki_native->openai; # warns: model not mapped, uses default
print $oai->simple_chat('Hello via OpenAI format!');
DESCRIPTION
Provides access to AKI.IO's OpenAI-compatible API at https://aki.io/openai/v1. Composes Langertha::Role::OpenAICompatible for the standard OpenAI format.
AKI.IO is a European AI model hub (Germany) — fully GDPR-compliant with all inference on EU infrastructure. Supports chat completions (with SSE streaming), dynamic model listing, and native OpenAI-standard tool calling: tools go out as the tools array and come back as a tool_calls block, the shared default of Langertha::Role::Tools. Verified live against llama3-chat-8b, one model AKI's own support table rates only "Basic Support", so the weakest documented case works — earlier releases routed this engine through Langertha::Role::HermesTools instead, which is no longer necessary.
Embeddings and transcription are not supported. For native AKI.IO API features (top_k, top_p, max_gen_tokens), use Langertha::Engine::AKI.
Chain-of-thought: AKI.IO returns the model's reasoning under the bare reasoning key on the message. The shared OpenAI-compatible path reads that spelling (canonical reasoning_content first, then bare reasoning) onto "thinking" in Langertha::Response, so $response->thinking is populated.
Vision: images in content go out as image_url parts. supports('image_input') is true only for the qwen3.6-*, qwen3.8-* and gemma4-* models, the families verified to see an image on this endpoint; other models make no claim, which never stops an image from being sent.
Client errors arrive as HTTP 529: AKI.IO returns some caller-side errors as 529 overloaded_error — notably a token budget too small to finish a tool call ("Response finished before tool_call was completed! Try to raise max_gen_tokens"). That condition is deterministic and fixed by raising response_size / max_tokens, not transient server overload: do not treat an AKI 529 as a wait-and-retry signal, and read $error->{error}{message} for the real diagnostic.
Get your API key at https://aki.io/ and set LANGERTHA_AKI_API_KEY.
THIS API IS WORK IN PROGRESS
api_key
The AKI.IO API key. If not provided, reads from LANGERTHA_AKI_API_KEY environment variable. Sent as a Bearer token in the Authorization HTTP header. Required.
default_model
Returns gpt-oss-120b, a current-generation non-MiniMax model AKI.IO rates "Supported", replacing llama3-chat-8b, which AKI.IO marks end-of-life 2026-09-30. AKI.IO exposes MiniMax M3 only on its native endpoint, not this shim; the shim's only MiniMax id (minimax-m2.5-230b) is the older generation.
SEE ALSO
Langertha::Engine::AKI - Native AKI.IO API (with top_k, top_p, max_gen_tokens)
Langertha::Role::OpenAICompatible - OpenAI API format role composed by this engine
https://aki.io/docs - AKI.IO API documentation
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.