# Resource Usage Logs

## Add new resource usage log.

> Add new resource usage log using type and amount.

```json
{"openapi":"3.0.0","info":{"title":"AI Agent API","version":"1.0.0"},"servers":[{"url":"https://api.raia2.com","description":"Production server"}],"security":[{"Agent-Secret-Key":[]}],"components":{"securitySchemes":{"Agent-Secret-Key":{"type":"apiKey","in":"header","name":"Agent-Secret-Key","description":"Custom authentication header"}},"schemas":{"CreateResourceUsageLogsBodyDto":{"type":"object","properties":{"type":{"type":"string","enum":["OPENAI_TOKENS","VAPI_SECONDS"],"description":"The type of resource consumed"},"amount":{"type":"number","description":"The amount of resource consumed."}},"required":["type","amount"]},"ForbiddenErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":403},"name":{"type":"object","default":"FORBIDDEN_ERROR"},"message":{"type":"string","default":"INVALID_CREDENTIALS"},"details":{"type":"array","items":{"type":"object"}}},"required":["status","name","message","details"]},"InternalServerErrorDTO":{"type":"object","properties":{"status":{"type":"number","default":500},"message":{"type":"string","default":"Internal Server Error"}},"required":["status","message"]}}},"paths":{"/external/resource-usage":{"post":{"description":"Add new resource usage log using type and amount.","operationId":"ExternalApiResourceConsumptionLogsController_createResourceConsumptionLog","parameters":[],"requestBody":{"required":true,"description":"Provide type and amount of resource used.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceUsageLogsBodyDto"}}}},"responses":{"201":{"description":"Successfully add resource usage log."},"403":{"description":"Invalid API key or secret key. Ensure that you are using a valid authentication key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Unexpected error occurred while processing the request. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Add new resource usage log.","tags":["Resource Usage Logs","Agent API Key"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raiaai.com/api-reference/resource-usage-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
