To convert Snakecase to Camelcase with Moshi, @JsonClass(generateAdapter = true) and @Json annotation are needed.

@JsonClass(generateAdapter = true)
data class GitHubUser(
val name: String,
val id: String,
@Json(name = "avatar_url")
val avatarUrl: String
)

Library versions are below. In addition to retrofit converter, Moshi itself and codegen are included.

dependencies {
// Retrofit2
implementation "com.squareup.retrofit2:retrofit:${RetrofitVersion}"
implementation "com.squareup.retrofit2:converter-moshi:${RetrofitVersion}"

// Moshi
implementation "com.squareup.moshi:moshi:${MoshiVersion}"
kapt "com.squareup.moshi:moshi-kotlin-codegen:${MoshiVersion}"
}

To use Moshi itself, you can hand the instance to MoshiConverterFactory.

GitHubApi = Retrofit.Builder()
.baseUrl(BuildConfig.BASE_URL)
.addConverterFactory(MoshiConverterFactory.create(Moshi.Builder().build()))
.addCallAdapterFactory(CoroutineCallAdapterFactory())
.build()
.create(GitHubApi::class.java)