{"uid":"cap_mqiZJki4u6dQg7HOaOOR8","slug":"delx-ensure-prefix-233bd453","name":"Delx Ensure Prefix","description":"Ensure a string starts with a required prefix without duplication — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that alrea…","url":"https://api.delx.ai/api/v1/x402/ensure-prefix","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."},"prefix":{"type":"string","description":"Input field: prefix."}}},"responseSchema":{"type":"json","example":{"text":"https://api.delx.ai","prefix":"https://","schema":"delx/util-ensure-prefix/v1","already_present":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_uU4hnKOyJotDDwN-vG4vO","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Ensures a string starts with a required prefix, adding it if missing without duplicating it if already present","exampleAgentPrompt":"Make sure the string 'example.com' starts with 'https://' — add the prefix if it's missing but don't duplicate it if it's already there.","exampleUseCases":[{"title":"Normalize user-supplied URLs","prompt":"The user just gave me a URL 'www.mysite.com' and I need to make sure it starts with 'https://' before I pass it downstream — can you ensure that prefix without duplicating it if it's already there?"},{"title":"Enforce namespace prefix on IDs","prompt":"I have an identifier 'order-4892' and I need to guarantee it starts with the prefix 'prod:' before storing it — add the prefix if missing but don't double it up if it's already there."},{"title":"Sanitize file paths for agent pipeline","prompt":"Before I pass this path '/data/logs/output.txt' into the pipeline, make sure it starts with '/var' — prepend the prefix only if it isn't already present."}],"resultDescription":"Returns a deterministic JSON object containing the resulting string that is guaranteed to start with the specified prefix exactly once, regardless of whether the original input already had it or not.","failureModes":["Missing required 'text' or 'prefix' field returns an error response","Empty prefix string may produce undefined normalization behavior","Very long strings may hit payload size limits","Payment failure via x402 prevents execution and returns 402 status"],"whenToPreferThis":"Choose this endpoint when you need a stateless, deterministic, idempotent micro-utility to normalize string prefixes in an agent pipeline without writing inline logic. It is ideal for preflight sanitization of URLs, file paths, namespaced IDs, or tagged strings where you must guarantee exactly-once prefix presence. Prefer it over custom code when you want a machine-readable JSON result for $0.001 USDC with no side effects, no data retention, and no external dependencies.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:16.135Z","isFirstParty":false}