{"uid":"cap_AmPrYQYTkGg-c-Fd0NAfa","slug":"mime-type-guesser-from-filename-f967ce06","name":"MIME Type Guesser from Filename","description":"Guess MIME type from a filename extension with a declared-type fallback.","url":"https://x402-zoo.lolagent.workers.dev/api/mime-guess","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":[],"properties":{"filename":{"type":"string"},"declared_type":{"type":"string"}}}},"additionalProperties":false}}},"responseSchema":null,"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_Z7UF_lpckNjtv05xHlX6g","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":"Returns the MIME type for a given filename by inspecting its extension, with an optional declared-type fallback if the extension is ambiguous or unrecognized.","exampleAgentPrompt":"What MIME type should I use for a file called 'archive.tar.gz'? If you can't figure it out from the extension, fall back to 'application/octet-stream'.","exampleUseCases":[{"title":"Set correct HTTP Content-Type header","prompt":"I'm about to serve a file called 'presentation.pptx' from my API — what Content-Type header should I set for it?"},{"title":"Validate upload file type","prompt":"A user just uploaded a file named 'photo.webp'. What MIME type does that extension correspond to so I can check it's an image?"},{"title":"Unknown extension with fallback","prompt":"What's the MIME type for a file called 'data.bin'? Use 'application/octet-stream' as the fallback if the extension isn't recognized."}],"resultDescription":"Returns the guessed MIME type string (e.g. 'video/mp4', 'application/pdf') inferred from the filename's extension. If the extension is unrecognized and a declared_type was provided, that fallback type is returned instead.","failureModes":["Unrecognized or missing file extension with no declared_type fallback — may return a generic or empty type","Ambiguous extensions that map to multiple MIME types — returns one best guess without disambiguation","Malformed filename with no extension — may fail to infer any type","Missing required filename query parameter — returns an error response"],"whenToPreferThis":"Use this endpoint when you need a fast, lightweight MIME type lookup from a filename or extension without running file content analysis. Ideal for setting HTTP Content-Type headers, validating upload file types, or enriching file metadata pipelines. Prefer this over full file-sniffing tools when only the filename is available and a declared-type safety net is sufficient.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:58:56.870Z","isFirstParty":false}