Give your coding assistant our API reference
Give your coding assistant the AffiliateOS reference file for your role before you ask it for code. Each file is plain Markdown with our real endpoints, fields and rules, so the assistant builds on what exists instead of guessing.
On this page
- Know which file you need: publisher, advertiser or network. Each covers one role.
- Keep real keys out of the chat. The files never need one, and your code should read keys from your server’s environment.
Developer docs, then AI context files
Open the AI context files on the developer docs. There is one file per role:
File For What it covers /ai/publisher.mdPublishers Keys, the Offer API and Top Offers Feed, tracking links, postbacks and signatures, the Hosted Offerwall /ai/advertiser.mdAdvertisers Products, campaigns and events, afos_click_id, server events, test events and every response status/ai/network.mdNetworks The Network API, paging, tracking links for your publishers, postbacks and verifying them Copy for AI, or download the file
Copy for AI puts the whole file on your clipboard. The download link beside it saves it as a file. Paste it into the assistant’s chat, or add the file to your project so the assistant reads it next to your code.
Copy prompt
Under the files, Copy prompt copies the instruction we suggest sending right after the file:
Read the attached AffiliateOS reference before writing any code. Use only the endpoints and fields it lists, and ask me for keys instead of inventing them. Keep every key on the server.
Add help articles when it needs more
Every help article has Copy page and View as Markdown under its title, and also lives at its own address ending in
.md. If your assistant can read links, start it at /help/llms.txt: an index of every article, the developer reference and the three files.Check it worked
Ask a question only the file answers, such as “Which postback parameter tells me whose balance to credit, and what do I dedupe on?” A good answer names
sub_id, thenaction_idandstatustogether. If it invents an endpoint, or a host such asapi.affiliateos.xyz(every call goes tohttps://affiliateos.xyz), paste the file again and resend the prompt.
Signed in, each portal has its own copy:
- Publishers: Docs, then AI Integration Assistant, then Download partner-ai-context.md.
- Networks: Docs has the same panel, with Download network-ai-context.md.
- Advertisers: each campaign’s page has AI docs for your developer. Copy AI playbook copies a step-by-step integration guide with that campaign’s IDs filled in, and Download .md saves it. Your API key is never in it: mint it yourself and add it to your server.
The portal files come from the API itself. The files on this site are snapshots and say on their first lines when they were checked. Changes after that date are in the changelog, and the developer docs list the latest changes for integrations.
Each file ends with rules like these:
- Never ship an API key, postback secret or wall secret in an app or a web page.
- Publishers and networks: never credit a postback that fails verification, or one with
test=true. - Publishers and networks: never reuse one
sub_idfor several users. - Advertisers: send events from your server, never from the app.