so here is the thing. i work on a laravel app where almost every feature touch an llm. extract structured data from a pdf, rewrite a paragraph, summarize, spell check, generate stuff. all of it go through prism, which is nice because i just write Prism::text()->using('gemini', 'gemini-2.5-flash') and forget about http clients.
but the api bill is the api bill. and i already pay for claude code subscription every month, sitting there, doing nothing when i sleep.
then i realize: claude code cli is just a binary. it take stdin, it print json to stdout. that is basically an llm api with extra steps. so why not make prism talk to it?
this post is how i did it. the whole thing is one class.
what prism actually want from a provider
prism is not magic. a provider is a class extending Prism\Prism\Providers\Provider and implementing the methods you care about. you do not need to implement everything. i only need two:
text(TextRequest $request): TextResponse
structured(Structu
Discussion
Begin the discussion
Begin something meaningful by sharing your ideas.