Get Organization Neurocredits Usage (By ID)

Request

GET

https://api.sourcecraft.tech/orgs/id:{org_id}/stats/neurocredits

Path parameters

Name

Description

org_id

Type: string

Example: ``

Query parameters

Name

Description

start_date

Type: string

Start date in YYYY-MM-DD format

Example: ``

end_date

Type: string

End date in YYYY-MM-DD format. Defaults to today.

Example: ``

page_size

Type: string<uint64>

The maximum number of items to return. The service may return fewer than
this value

Example: ``

page_token

Type: string

A page token, received from a previous call.
Provide this to retrieve the subsequent page.

When paginating, all other parameters must match
the call that provided the page token.

Example: ``

Responses

200 OK

A successful response.

Body

application/json
{
  "entries": [
    {
      "user": {
        "id": "example",
        "slug": "example"
      },
      "date": "example",
      "model": "example",
      "product": "vscode_plugin",
      "neurocredits": 0.5
    }
  ],
  "next_page_token": "example"
}

Name

Description

entries

Type: NeurocreditsUsageEntry[]

Example
[
  {
    "user": {
      "id": "example",
      "slug": "example"
    },
    "date": "example",
    "model": "example",
    "product": "vscode_plugin",
    "neurocredits": 0.5
  }
]

next_page_token

Type: string

Example: example

UserEmbedded

Name

Description

id

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example"
}

AIProduct

Type: string

Enum: vscode_plugin, jb_plugin, cli, neuro_features, sourcecraft_web_chat

NeurocreditsUsageEntry

Name

Description

date

Type: string

Example: example

model

Type: string

Example: example

neurocredits

Type: number

product

Type: AIProduct

Enum: vscode_plugin, jb_plugin, cli, neuro_features, sourcecraft_web_chat

user

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}
Example
{
  "user": {
    "id": "example",
    "slug": "example"
  },
  "date": "example",
  "model": "example",
  "product": "vscode_plugin",
  "neurocredits": 0.5
}

default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": {}
}

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example