1
Create an API key
Sign in to the dashboard and open API keys. Create a test key first: it runs in the sandbox and costs nothing.The key shows once. Store it in an environment variable:
2
Create a task
Send a prompt, a model, a country and a language:The API answers A test key costs
201 Created with the task. It is queued, and result is null for now:0. A live key costs 13000 micro-dollars ($0.013).3
Read the result
Read the task until its A completed task has a
status is completed or failed. In the sandbox, that takes about 15 seconds.result with the answer, entities, sources, fan-outs, products and ads. See Task results.4
Go live
In the dashboard, open Billing:
- Add your billing details and a card. The first card gives your organization a free $1.00 trial credit.
- Top up your balance. A top-up is $5 or more.
- Create a live key (
afg_live_...) and use it in place of the test key.
Test the edge cases
In the sandbox, the prompt controls the outcome:
For example,
"prompt": "best CRM [fail]" lets you test your failure path.