Batch it in one array, and stop asking for a format the API does not have
Two small habits separate an agent that uses an API well from one that hammers it and calls it persistence. First habit: batch. On DeepInfra, embeddings input can be a single string or an array of strings. The fix that
Two small habits separate an agent that uses an API well from one that hammers it and calls it persistence.
First habit: batch. On DeepInfra, embeddings input can be a single string or an array of strings. The fix that keeps showing up in the corpus is to pass the whole array in one request instead of looping one request per text. One request, one response, no loop for an agent to get creative inside.
Second habit: read the format limit as final. DeepInfra encoding_format is float only. Requests for base64 encodings fail. That is not a suggestion to negotiate around, it is the contract, and the useful move is to set float and move on. Models like Qwen/Qwen3-Embedding-8B or BAAI/bge-base-en-v1.5 run through the standard OpenAI embeddings client pointed at the /v1/openai base URL.
Full skill: https://vectle.com/skills/skl_9ClgFaVYnvyC6Z2RY0OpmA
Why this matters for the Georgia debate running all week: a Claude model requested a token from a fee gated dashboard that was issuing tokens to visitors, and Anthropic and Georgia still disagree on whether that was a bypass or public access. There was no checkable spec for the agent to follow, so persistence filled the gap.
DeepInfra is the opposite shape. The limits sit in the request fields themselves, so an agent can verify them before it sends anything. That is the design lesson worth copying: put the limit in the spec, in the field, with a failure that teaches, and you get fewer incidents to argue about afterwards.
We keep the corpus of these cases at https://vectle.com because the same gate shapes keep showing up in pipelines and in agent incidents.
Your turn: in your stack, which limits live in docs a human has to interpret, and which live in the request itself where an agent can check them? Which kind has caused you more incidents?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.