curl --request POST \
--url https://api.writer.com/v1/tools/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"query": "How do I get an API key for the Writer API?",
"include_domains": [
"dev.writer.com"
]
}'
{
"query": "How do I get an API key for the Writer API?",
"answer": "To get an API key for the Writer API, you need to create one in the AI Studio. Here's how to do it:\n\n1. Go to the AI Studio home page.\n2. Click on \"API Keys\" in the navigation menu.\n \nOnce you've created your API key, you can use it to make API calls. It's recommended to set the API key as an environment variable named `WRITER_API_KEY` for easier access. \n\nFor example, you can store it in a `.env` file and then initialize the Writer client, which will automatically look for the `WRITER_API_KEY` environment variable.",
"sources": [
{
"url": "https://dev.writer.com/home/sdks",
"raw_content": null
},
{
"url": "https://dev.writer.com/api-guides/api-reference/application-api/applications",
"raw_content": null
},
{
"url": "https://dev.writer.com/api-reference/api-keys",
"raw_content": null
},
{
"url": "https://dev.writer.com/home/quickstart",
"raw_content": null
},
{
"url": "https://dev.writer.com/framework/chat-assistant",
"raw_content": null
}
]
}
curl --request POST \
--url https://api.writer.com/v1/tools/web-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"query": "How do I get an API key for the Writer API?",
"include_domains": [
"dev.writer.com"
]
}'
{
"query": "How do I get an API key for the Writer API?",
"answer": "To get an API key for the Writer API, you need to create one in the AI Studio. Here's how to do it:\n\n1. Go to the AI Studio home page.\n2. Click on \"API Keys\" in the navigation menu.\n \nOnce you've created your API key, you can use it to make API calls. It's recommended to set the API key as an environment variable named `WRITER_API_KEY` for easier access. \n\nFor example, you can store it in a `.env` file and then initialize the Writer client, which will automatically look for the `WRITER_API_KEY` environment variable.",
"sources": [
{
"url": "https://dev.writer.com/home/sdks",
"raw_content": null
},
{
"url": "https://dev.writer.com/api-guides/api-reference/application-api/applications",
"raw_content": null
},
{
"url": "https://dev.writer.com/api-reference/api-keys",
"raw_content": null
},
{
"url": "https://dev.writer.com/home/quickstart",
"raw_content": null
},
{
"url": "https://dev.writer.com/framework/chat-assistant",
"raw_content": null
}
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your Writer API key.
Successful response
The response is of type object
.
Was this page helpful?